ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How not to fixed cell address in Macros (https://www.excelbanter.com/excel-programming/295145-how-not-fixed-cell-address-macros.html)

Teak[_2_]

How not to fixed cell address in Macros
 
I used macro to record some steps.
When I run the macro, I got errors becos the cell address are hard-coded in
the macro.
what to do if I want the macro to do things like these, starting at the
active cell?

subtotal
move 2 cells left
type a text
insert a row





Tushar Mehta

How not to fixed cell address in Macros
 
See the Excel/VBA/Beyond Excel's recorder page of my web site.

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Business solutions leveraging technology
Microsoft Most Valuable Professional (MVP) 2000-2004

In article , oswald88
@singnet.com.sg says...
I used macro to record some steps.
When I run the macro, I got errors becos the cell address are hard-coded in
the macro.
what to do if I want the macro to do things like these, starting at the
active cell?

subtotal
move 2 cells left
type a text
insert a row






Gord Dibben

How not to fixed cell address in Macros
 
Teak

When recording the macro, first hit the "Relative Reference" button on the
Stop Recording Toolbar.

Gord Dibben Excel MVP



On Thu, 15 Apr 2004 10:40:53 +0800, "Teak" wrote:

I used macro to record some steps.
When I run the macro, I got errors becos the cell address are hard-coded in
the macro.
what to do if I want the macro to do things like these, starting at the
active cell?

subtotal
move 2 cells left
type a text
insert a row






All times are GMT +1. The time now is 09:55 AM.

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