MartinSpellacy
New Member
- Joined
- Jun 6, 2018
- Messages
- 4
Hi,
I have the below table which has 5 colums in it. The data in columns B to D is already populated for me however the only data in column A is found in Cell A2. I have created a macro to auto fill column A ( please see below). In my example I have 236 rows to autofil.
My problem is this.... my row range is dynamic and I may have less or more rows. How to I edit the macro so that it autofills to the potential last row?
Thanks in advnace
[TABLE="width: 345"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Depot [/TD]
[TD] WIP [/TD]
[TD]Dept[/TD]
[TD]Status[/TD]
[TD]Date In[/TD]
[/TR]
[TR]
[TD="align: center"]Aberdeen[/TD]
[TD="align: center"]22717[/TD]
[TD="align: center"] W[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]28/03/2018[/TD]
[/TR]
[TR]
[TD="align: center"]Aberdeen[/TD]
[TD="align: center"]24105 [/TD]
[TD="align: center"] W[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]27/04/2018[/TD]
[/TR]
[TR]
[TD="align: center"]Aberdeen[/TD]
[TD="align: center"]24048[/TD]
[TD="align: center"] W[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]05/04/2018[/TD]
[/TR]
[TR]
[TD="align: center"]Aberdeen[/TD]
[TD="align: center"]24330[/TD]
[TD="align: center"] W[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]05/04/2018[/TD]
[/TR]
</tbody>[/TABLE]
Sheets("Ab").Select
Range("A2").Select
Selection.autofill Destination:=Range("A2:A236")
Range("A2:A236").Select
I have the below table which has 5 colums in it. The data in columns B to D is already populated for me however the only data in column A is found in Cell A2. I have created a macro to auto fill column A ( please see below). In my example I have 236 rows to autofil.
My problem is this.... my row range is dynamic and I may have less or more rows. How to I edit the macro so that it autofills to the potential last row?
Thanks in advnace
[TABLE="width: 345"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Depot [/TD]
[TD] WIP [/TD]
[TD]Dept[/TD]
[TD]Status[/TD]
[TD]Date In[/TD]
[/TR]
[TR]
[TD="align: center"]Aberdeen[/TD]
[TD="align: center"]22717[/TD]
[TD="align: center"] W[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]28/03/2018[/TD]
[/TR]
[TR]
[TD="align: center"]Aberdeen[/TD]
[TD="align: center"]24105 [/TD]
[TD="align: center"] W[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]27/04/2018[/TD]
[/TR]
[TR]
[TD="align: center"]Aberdeen[/TD]
[TD="align: center"]24048[/TD]
[TD="align: center"] W[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]05/04/2018[/TD]
[/TR]
[TR]
[TD="align: center"]Aberdeen[/TD]
[TD="align: center"]24330[/TD]
[TD="align: center"] W[/TD]
[TD="align: center"]1[/TD]
[TD="align: center"]05/04/2018[/TD]
[/TR]
</tbody>[/TABLE]
Sheets("Ab").Select
Range("A2").Select
Selection.autofill Destination:=Range("A2:A236")
Range("A2:A236").Select