VBA Code to Copy

Some videos you may like

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

Momentman

Well-known Member
Joined
Jan 11, 2012
Messages
4,066
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
1. Highlight all cells
2. press F5 (Go to)
3. click special
4. select blanks (to select only blank cells), click Ok
5. in any of the cells highlighted, type the formula = "the cell above it" e.g if in cell A23, type = A22
6. press ctrl+enter not just enter to fill all highlighted cells
7. you can then paste as values
 

Herbiec09

Active Member
Joined
Aug 29, 2006
Messages
250
1. Highlight all cells
2. press F5 (Go to)
3. click special
4. select blanks (to select only blank cells), click Ok
5. in any of the cells highlighted, type the formula = "the cell above it" e.g if in cell A23, type = A22
6. press ctrl+enter not just enter to fill all highlighted cells
7. you can then paste as values

Thanks bro, but I was looking for a VBA code. New link is https://docs.google.com/a/talarius.co.zw/file/d/0B91u5j5KZfFYTWZPM2Ffcl9MMEU/edit?pli=1

Many Thanks
 

Momentman

Well-known Member
Joined
Jan 11, 2012
Messages
4,066
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I kinda hard coded the range. Try it on a copy of the data
Code:
Sub Macro1()
    Range("A4:C27, F4:F27").Select
    Selection.SpecialCells(xlCellTypeBlanks).Select
    Selection.FormulaR1C1 = "=R[-1]C"
    
End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,122,691
Messages
5,597,562
Members
414,156
Latest member
WDMix

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top