![]() |
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. |
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. |
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. |
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. |
All times are GMT +1. The time now is 11:41 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com