VBA Code to copy down in blank cells and repeat until no data

Trebor200

Board Regular
Joined
Apr 21, 2015
Messages
67
Office Version
  1. 365
Platform
  1. Windows
I appreciate any help you can offer on this,

In column A i have a product code, i want to copy this down into the blank cells below until i hit the next product number and repeat until no more product numbers.

The blanks spaces in between can vary and the product numbers can vary also.

Thanks in advance.

I have added Excel file to drop box.
VBA Test is the raw data and VBA Need is what i want to accomplish.

https://www.dropbox.com/s/xldi11bd2vfxu08/VBA%20Test.xlsx?dl=0
 

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
How about

Code:
With Range("A:A").Resize(Range("D65536").End(xlup).Row, 1)
    .SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "R[-1]C"
    .Value = .Value
End With
 
Upvote 0
thanks for the reply, that added R[-1]C to each of the blank cells and not the product number?
 
Upvote 0
I forgot the equal sign
Code:
.SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "[COLOR="#FF0000"][B]= [/B][/COLOR]R[-1]C"
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,375
Messages
6,119,166
Members
448,870
Latest member
max_pedreira

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
Back
Top