Macro for Fill Handle

chrono2483

Board Regular
Joined
Aug 23, 2014
Messages
164
Office Version
  1. 2016
Hello,

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]1
[/TD]
[TD][/TD]
[TD]December 1
[/TD]
[TD]Hot Dog
[/TD]
[TD]2
[/TD]
[/TR]
[TR]
[TD]2
[/TD]
[TD][/TD]
[TD]December 1
[/TD]
[TD]Hot Dog
[/TD]
[TD]3
[/TD]
[/TR]
[TR]
[TD]3
[/TD]
[TD][/TD]
[TD]December 1
[/TD]
[TD]Hot Dog
[/TD]
[TD]4
[/TD]
[/TR]
[TR]
[TD]4
[/TD]
[TD][/TD]
[TD]December 1
[/TD]
[TD]Hot Dog
[/TD]
[TD]6
[/TD]
[/TR]
[TR]
[TD]5
[/TD]
[TD][/TD]
[TD]December 1
[/TD]
[TD]Hamburger
[/TD]
[TD]7
[/TD]
[/TR]
[TR]
[TD]6
[/TD]
[TD][/TD]
[TD]December 1
[/TD]
[TD]Hamburger
[/TD]
[TD]8
[/TD]
[/TR]
[TR]
[TD]7
[/TD]
[TD][/TD]
[TD]December 1
[/TD]
[TD]Hamburger
[/TD]
[TD]1
[/TD]
[/TR]
[TR]
[TD]8
[/TD]
[TD][/TD]
[TD]December 2
[/TD]
[TD]Hot Dog
[/TD]
[TD]5
[/TD]
[/TR]
[TR]
[TD]9
[/TD]
[TD][/TD]
[TD]December 2
[/TD]
[TD]Hot Dog
[/TD]
[TD]7
[/TD]
[/TR]
</tbody>[/TABLE]


Hoping someone could help with the following. I searched online for a macro (piece together a macro to do the following):

I want to be able to auto fill/fill handle data in Column C, so that C1 copies down to C4, then find the next Cell with data in Col C (C5) and copy down to C7, etc.

I've tried the following:

Dim lRow As Long
lRow = Cells(Rows.Count,1).End(x1up).Row
Range("C:C").autofill destination:=range("C:C" & cells(rows.count,"C").end(xlup).row)

But I don't think I've applied the code correctly.

Would anyone be able to help?

Thank you.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Do you want to fill in the blanks in column C?
 
Upvote 0
perhaps this as part of the loop
Code:
        If ActiveSheet.ActiveCell.Value = "" Then
        ActiveSheet.ActiveCell.Value = ActiveSheet.ActiveCell.Offset(-1, 0).Value

also, how are you determining when to end the loop
 
Upvote 0
It won't resolve your issue but just for future reference the red 1 in the below should be a lower case L.

Cells(Rows.Count,1).End(x1up).Row
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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