Autofill???

Parra

Well-known Member
Joined
Feb 21, 2002
Messages
752
I don't know how to do this but I want to add this to a macro.

In cell a1 there is a date (the rest of the column is blank) and in the column next to it, column b, there is text, about 200 rows.

How would I get the date to automatically fill in the cells, when there is text to the right of it?

Thanks
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Try the following code:

Range("a1").Select
Selection.AutoFill Destination:=Range("b1:b200").Offset(0, -1)

Change ("b1:b200") to whatever the range is in column B. This will work if the column always the same size.
 
Upvote 0
You can find the used range in column B. Try the following code:

ColumnBRange = Intersect(ActiveSheet.UsedRange, Columns("B")).Address
Range("a1").Select
Selection.AutoFill Destination:=Range(ColumnBRange).Offset(0, -1), Type:=xlFillCopy





_________________
Hope this helps.
Kind regards, Al.
This message was edited by Al Chara on 2002-04-01 13:33
 
Upvote 0
Well it kinda worked. It did what it was suppose to but the date changed, from 1/1 to 1/2 to 1/3 etc.

Any ideas how to keep it the same?

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,020
Members
448,939
Latest member
Leon Leenders

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