98.8% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel Training and help » Cut and paste replacement values
Cut and paste replacement values
Resolved · Medium Priority · Version 2013
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
Fri 15 Jul 2016: Automatically marked as resolved.
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Change Excel's default fontYou can change the default font and font size for all spreadsheets created in Excel by: |