ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Replacing cell ref with active cell (https://www.excelbanter.com/excel-programming/366402-replacing-cell-ref-active-cell.html)

[email protected]

Replacing cell ref with active cell
 
In this recorded macro, I go to Cell A1001, select it, drag the fill
handle to the cell below.

Q: How can I edit the macro to select the active cell and go down one
row, instead of the exact cell values in the brackets after Range?
(newbie question) Is there a syntax similar to:

Range(Activecell).Select
Then
Range("Activecell:ActiveCell+1)

???

--- recorded macro ---
Application.Goto Reference:="R1001C1"
ActiveWindow.SmallScroll Down:=3
Range("A1001").Select
Selection.AutoFill Destination:=Range("A1001:A1002"),
Type:=xlFillDefault
Range("A1001:A1002").Select
--- end of recorded macro ---

thanks in advance
PUBA


Norman Jones

Replacing cell ref with active cell
 
Hi Puba,

Try:

Activecell.Offset(1).Select

However, it is rareley necessary, or desirable, to make selections.

If you look at my suggested autofill code, you will see that i use a range
object rather than making selections.



---
Regards,
Norman



wrote in message
ups.com...
In this recorded macro, I go to Cell A1001, select it, drag the fill
handle to the cell below.

Q: How can I edit the macro to select the active cell and go down one
row, instead of the exact cell values in the brackets after Range?
(newbie question) Is there a syntax similar to:

Range(Activecell).Select
Then
Range("Activecell:ActiveCell+1)

???

--- recorded macro ---
Application.Goto Reference:="R1001C1"
ActiveWindow.SmallScroll Down:=3
Range("A1001").Select
Selection.AutoFill Destination:=Range("A1001:A1002"),
Type:=xlFillDefault
Range("A1001:A1002").Select
--- end of recorded macro ---

thanks in advance
PUBA





All times are GMT +1. The time now is 04:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com