LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Use variable in macro coding

If your variables are stored in cells, you can do something like the
following:
1. Assuming the value of mFrow is stored in A1 and the value of mLrow is
stored in A2.
2. In cell A3, write down the following:
=TEXT("H" & A1 & ":H" & A2, "")
3. In cell A4, you can get your sum with the following formula:
=SUM(INDIRECT(A3))

Basically, in cell A3, we are building up the expression "H1:H10" and in
cell A4, we are using the string in A3 to build the range using the
INDIRECT() function.

- Chirag

Shortcut Manager - Assign keyboard shortcuts to Excel menu items and
macros.
http://officeone.mvps.org/xlsctmgr/xlsctmgr.html

"bmurlidhar" wrote in message
...
I want to give sum command i.e. =SUM(H1:H10) and my variable for
mFrow = 1 and mLrow = 10 how can i use variable in function


 
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
Help on macro coding for URL Eric Excel Worksheet Functions 2 March 15th 08 02:02 PM
Please help on coding the macro. Eric Excel Worksheet Functions 0 March 11th 08 03:11 PM
HELP - coding on Macro! Eric Excel Worksheet Functions 3 February 21st 08 12:26 AM
Including a third variable in a point diagram by color-coding Celia Excel Discussion (Misc queries) 1 January 29th 08 04:47 PM
coding macro Boss Excel Discussion (Misc queries) 0 November 13th 07 12:17 PM


All times are GMT +1. The time now is 03:05 PM.

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

About Us

"It's about Microsoft Excel"