Bryony has attended:
Excel VBA Introduction course
Cut and paste replacement values
I wish to be able to identify blank cells in column A (for example), and if blank, to cut and paste the value from column B (corresponding row)into column A.
RE: Cut and paste replacement values
Hi Bryony,
Thank you for the forum question.
The code below can do the job. In my example I run through the range A6:A500. You will may be need to change this.
Sub CopyColB()
For Each cell In Range("a6:a500").SpecialCells(xlCellTypeBlanks)
cell.Value = cell.Offset(0, 1)
Next cell
End Sub
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
RE: Cut and paste replacement values
Hi Bryony,
I am sorry.
You want to cut. Then the code will be:
Sub CopyColB()
For Each cell In Range("a6:a500").SpecialCells(xlCellTypeBlanks)
cell.Value = cell.Offset(0, 1)
cell.Offset(0, 1).ClearContents
Next cell
End Sub
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
Best STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector