Autofill a column

paulland

New Member
Joined
Mar 4, 2013
Messages
2
Hi,
I'm new to VB code and can't figure out where to start with this macro, which should be simple:
Data in column A consists of a number, followed by a series of blanks in row A (there is data in columns B:G that corresponds to the entry in column A), then a new entry in column A. Like this:

AB
valuedata
data
data
data
value 2data
data
data
value 3data
value 4data
data
data
data
...
valuedata

<tbody>
</tbody>

The number of rows between values in column A is dynamic.
I just want to copy down the column A value until the data in column A changes, then repeat with the new value, like this.
AB
valuedata
valuedata
valuedata
valuedata
value 2data
value 2data
value 2data
value 3data
value 4data
value 4data
value 4data
value 4data
...
value ndata

<tbody>
</tbody>

This should be easy but I don't know where to start. Any suggestions? I can use Autofill to get to the bottom of the column, but am clearly not smart enough to figure out how to make it dynamic.
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Welcome to MrExcel.

Select column A and choose Edit|Go To|Special|Blanks|OK. Go to the Formula Bar, type =, point to the cell above the active cell and press Ctrl+Enter. The macro recorder should give you some code.
 
Upvote 0
You can do this without VBA.
But if you insist on VBA method, then use the Macro Recorder to record yourself doing the following Steps.

Select Column A
Press CTRL + G
Click Special
Select "Blanks"
Click OK
Press =
Press UP Arrow
Press CTRL + ENTER
Highlight Column A Again
Right click - copy
Right click - Paste Special
Select Values
Click OK


Hope that helps.
 
Upvote 0
BrillianT! I knew there was an easier way. Thanks.

You can do this without VBA.
But if you insist on VBA method, then use the Macro Recorder to record yourself doing the following Steps.

Select Column A
Press CTRL + G
Click Special
Select "Blanks"
Click OK
Press =
Press UP Arrow
Press CTRL + ENTER
Highlight Column A Again
Right click - copy
Right click - Paste Special
Select Values
Click OK


Hope that helps.
 
Upvote 0

Forum statistics

Threads
1,216,458
Messages
6,130,754
Members
449,588
Latest member
accountant606

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