Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Inserting worksheet calculations into macros

I need to automate a macro to use calculated cell addresses in the macro (see
present macro)

Sub Macro4()
CELL = "AZ54"
RANGE (CELL).select
End Sub

How can I insert a calculated Cell Address for the AZ54 in the above macro?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,355
Default Inserting worksheet calculations into macros

I'm not following your question. Your macro does what (I understand) you
are asking for.

"arlen andrews" wrote:

I need to automate a macro to use calculated cell addresses in the macro (see
present macro)

Sub Macro4()
CELL = "AZ54"
RANGE (CELL).select
End Sub

How can I insert a calculated Cell Address for the AZ54 in the above macro?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,081
Default Inserting worksheet calculations into macros

Depends how you are calculating the address.

DIM strAddress as string
strAddress = "AZ"&54

if cell A1 on the active sheet contained an address like AZ54, you can do:

Range(range("A1").value).Select


BTW, you rarely need to SELECT a range. Most things can be done simply by
referencing the range. For example:

range("AZ54").formula = "=A1+c1"

"arlen andrews" wrote:

I need to automate a macro to use calculated cell addresses in the macro (see
present macro)

Sub Macro4()
CELL = "AZ54"
RANGE (CELL).select
End Sub

How can I insert a calculated Cell Address for the AZ54 in the above macro?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2
Default Inserting worksheet calculations into macros

Thanks, I will try one or both of your comments. I am using the Range
selection because that is what the macro generator spit out when I recorded
the macro, (I am still learning how to work with VBA and macros).

"Duke Carey" wrote:

Depends how you are calculating the address.

DIM strAddress as string
strAddress = "AZ"&54

if cell A1 on the active sheet contained an address like AZ54, you can do:

Range(range("A1").value).Select


BTW, you rarely need to SELECT a range. Most things can be done simply by
referencing the range. For example:

range("AZ54").formula = "=A1+c1"

"arlen andrews" wrote:

I need to automate a macro to use calculated cell addresses in the macro (see
present macro)

Sub Macro4()
CELL = "AZ54"
RANGE (CELL).select
End Sub

How can I insert a calculated Cell Address for the AZ54 in the above macro?

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,355
Default Inserting worksheet calculations into macros

The macro recorder doesn't give the most efficient macros. I generally clean
up the worksheet and/or range selection after I record a macro.

HTH,
Barb Reinhardt

"arlen andrews" wrote:

Thanks, I will try one or both of your comments. I am using the Range
selection because that is what the macro generator spit out when I recorded
the macro, (I am still learning how to work with VBA and macros).

"Duke Carey" wrote:

Depends how you are calculating the address.

DIM strAddress as string
strAddress = "AZ"&54

if cell A1 on the active sheet contained an address like AZ54, you can do:

Range(range("A1").value).Select


BTW, you rarely need to SELECT a range. Most things can be done simply by
referencing the range. For example:

range("AZ54").formula = "=A1+c1"

"arlen andrews" wrote:

I need to automate a macro to use calculated cell addresses in the macro (see
present macro)

Sub Macro4()
CELL = "AZ54"
RANGE (CELL).select
End Sub

How can I insert a calculated Cell Address for the AZ54 in the above macro?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting New Worksheet tim m Excel Discussion (Misc queries) 0 November 29th 06 04:58 PM
Inserting New Worksheet Problems with formula within worksheet Excel Discussion (Misc queries) 0 November 29th 06 04:47 PM
Inserting row in 1 worksheet and updating a different row in another worksheet [email protected] Excel Discussion (Misc queries) 0 August 9th 06 09:13 PM
Inserting commands in Macros Norton704 Excel Worksheet Functions 1 July 28th 05 06:32 PM
Calculations And Order In Macros Carl Bowman Excel Discussion (Misc queries) 4 February 23rd 05 10:53 PM


All times are GMT +1. The time now is 04:45 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"