Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
If I need to autofill column B from the last cell that has data in it to the
same row as the last cell of column A that has data in it, how do I set the destination for the autofill correctly? I have tried a lot of ways that seemed obvious and all of them return errors. Here is where I am stuck: Selection.AutoFill Destination:=Range(B[this number is the active cell, or the one I just put a value in in column B]:B[this number should be the same as the last cell that has a value in it in column A]) |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Try
Dim lngRow As Long lngRow = Cells(Rows.Count, "A").End(xlUp).Row Selection.AutoFill Destination:=Range("B" & ActiveCell.Row & ":B" & lngRow) -- Jacob (MVP - Excel) "AlexJarvis" wrote: If I need to autofill column B from the last cell that has data in it to the same row as the last cell of column A that has data in it, how do I set the destination for the autofill correctly? I have tried a lot of ways that seemed obvious and all of them return errors. Here is where I am stuck: Selection.AutoFill Destination:=Range(B[this number is the active cell, or the one I just put a value in in column B]:B[this number should be the same as the last cell that has a value in it in column A]) |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Good deal, thank you!
I was forgetting to put a "&" in there... -A "Jacob Skaria" wrote: Try Dim lngRow As Long lngRow = Cells(Rows.Count, "A").End(xlUp).Row Selection.AutoFill Destination:=Range("B" & ActiveCell.Row & ":B" & lngRow) -- Jacob (MVP - Excel) "AlexJarvis" wrote: If I need to autofill column B from the last cell that has data in it to the same row as the last cell of column A that has data in it, how do I set the destination for the autofill correctly? I have tried a lot of ways that seemed obvious and all of them return errors. Here is where I am stuck: Selection.AutoFill Destination:=Range(B[this number is the active cell, or the one I just put a value in in column B]:B[this number should be the same as the last cell that has a value in it in column A]) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to read value of a cell in a relative location | Excel Worksheet Functions | |||
Macro - save to current location vs excel default location | Excel Discussion (Misc queries) | |||
~ ~ ~ Its All Relative??? | Excel Discussion (Misc queries) | |||
Autofill: Need to autofill one week block, (5) weekday only into cells. | Excel Discussion (Misc queries) | |||
Relative reference autofill increment other than +1 | Excel Discussion (Misc queries) |