Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
LSB LSB is offline
external usenet poster
 
Posts: 8
Default Refering to Cell's Name in Macro

I am trying to work on some calculation in my macro. I
have named one the cells as "Brokerage_Commission" in, in
my Macro I would like to get this value to multiply with
another value. How can I refer the "Brokerage_Commission"
in my macro. The Brokerage_Commission is in different
worksheet as I want to put the result in another worksheet.

Please help.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 550
Default Refering to Cell's Name in Macro

LSB,

Range("Brokerage_Commission")
should do it.

Example:

Say Brokerage Commission = .05
In cell A1 (on the active sheet) you have 150

Sub TestMe()
MsgBox Range("Brokerage_Commission")*Range("A1")
End Sub

John

LSB wrote:

I am trying to work on some calculation in my macro. I
have named one the cells as "Brokerage_Commission" in, in
my Macro I would like to get this value to multiply with
another value. How can I refer the "Brokerage_Commission"
in my macro. The Brokerage_Commission is in different
worksheet as I want to put the result in another worksheet.

Please help.

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Refering to Cell's Name in Macro

brkCom = Range("Brokerage_Commission").Value


if you will be doing this in a sheet module and brokerage_commission is on
another sheet, you need to preface it with the sheetname. Assume
Brokerage_Commission is on sheet3.

brkCom = Worksheets("sheet3").Range("Brokerage_Commission") .Value

--
Regards,
Tom Ogilvy


LSB wrote in message
...
I am trying to work on some calculation in my macro. I
have named one the cells as "Brokerage_Commission" in, in
my Macro I would like to get this value to multiply with
another value. How can I refer the "Brokerage_Commission"
in my macro. The Brokerage_Commission is in different
worksheet as I want to put the result in another worksheet.

Please help.

Thanks.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Refering to Cell's Name in Macro

I don't believed I used tunneling as you have: [nRange]

Tunneling, while much slower, is perhaps less susceptible to this.

If you have never had a problem with references to other sheets in a sheet
module, god bless you. People post here all the time with such problems.

Regards,
Tom Ogilvy


Thomas wrote in message ...
I can't duplicate that.In sheet1 I name A1 as nRange
In Sheet1 module I have a sub with:
activecell.value = [nRange]
In sheet3 I call the sub.
It returns the value from nRange to the activecell without prefacing
with the sheet name.
OfficeXP

Tom Ogilvy wrote:

brkCom = Range("Brokerage_Commission").Value

if you will be doing this in a sheet module and brokerage_commission is

on
another sheet, you need to preface it with the sheetname. Assume
Brokerage_Commission is on sheet3.

brkCom = Worksheets("sheet3").Range("Brokerage_Commission") .Value

--
Regards,
Tom Ogilvy

LSB wrote in message
...
I am trying to work on some calculation in my macro. I
have named one the cells as "Brokerage_Commission" in, in
my Macro I would like to get this value to multiply with
another value. How can I refer the "Brokerage_Commission"
in my macro. The Brokerage_Commission is in different
worksheet as I want to put the result in another worksheet.

Please help.

Thanks.



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
Using a cell's value in a macro command TomHull Excel Discussion (Misc queries) 2 November 20th 09 07:45 AM
refering to other workbooks cjbarron5 Excel Discussion (Misc queries) 2 June 2nd 08 08:17 PM
Refering a cell Arun Kumar Saha Excel Worksheet Functions 2 June 18th 07 12:48 PM
Refering to Cells madh83 Excel Worksheet Functions 3 July 19th 06 11:39 PM
Refering cells between worksheets In Need Excel Worksheet Functions 2 November 23rd 05 07:22 PM


All times are GMT +1. The time now is 06:41 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"