cut and paste replacement

Forum home » Delegate support and help forum » Microsoft Excel Training and help » Cut and paste replacement values

Cut and paste replacement values

resolvedResolved · 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.


 

Excel tip:

Change Excel's default font

You can change the default font and font size for all spreadsheets created in Excel by:

1. Going to Tools on the menu bar.
2. Select Options, then General.
3. Next to Standard Font you can change the font and font size.
4. Click OK.

Each new file you start from this point onward should use the font and font size you have selected.

View all Excel hints and tips


Server loaded in 0.06 secs.