Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 542
Default Reference a variable declared in VBA

I have a question and dont have the slightest idea on how to go about it.
I have a cell G8 that will get text input to it. If G8 has text in it, then
cell B8 will input the persons name retrieved from VB with a public variable
name of "name."
I was thinking the best way to do this is with a formula in cell B8 that is
something like:

=IF(Range("G7").Value<"",Module1.Name,"")

Module1.Name is the Module and Public Variable in that module that i want to
reference.
any help would be great, not too familliar with formulas. thanks again!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 9
Default Reference a variable declared in VBA

I don't think you can get the variable from the VBA to the excel sheet
for formula use...

you either have to chnage the VBA, or you could do it in excel without
the VBA


one thing you could do is, to assign the names from the VBA to a list
on the worksheet(let's say it's P1) and then do Vlookup to match up
the name and values...


I'm not sure what's the situation is like, nor you're familiarity with
excel
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 542
Default Reference a variable declared in VBA

Ok, i think what im going to do is just output the value of the variable to
the sheet somewhere and then use that cell that i output to in the formula.
thanks for the response. much appreciated

"sameoldcalvin" wrote:

I don't think you can get the variable from the VBA to the excel sheet
for formula use...

you either have to chnage the VBA, or you could do it in excel without
the VBA


one thing you could do is, to assign the names from the VBA to a list
on the worksheet(let's say it's P1) and then do Vlookup to match up
the name and values...


I'm not sure what's the situation is like, nor you're familiarity with
excel

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 542
Default Reference a variable declared in VBA

ok, so if i output the variable contents to Range("I2") how do i implement the
range("G7").value<"" in the IF formula?

"sameoldcalvin" wrote:

I don't think you can get the variable from the VBA to the excel sheet
for formula use...

you either have to chnage the VBA, or you could do it in excel without
the VBA


one thing you could do is, to assign the names from the VBA to a list
on the worksheet(let's say it's P1) and then do Vlookup to match up
the name and values...


I'm not sure what's the situation is like, nor you're familiarity with
excel

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
Variable reference in countif Libby Excel Worksheet Functions 2 March 28th 08 06:24 PM
variable as a cell reference? jim sturtz Excel Worksheet Functions 5 August 28th 05 08:56 PM
How to use variable in reference Ming Excel Worksheet Functions 2 July 27th 05 11:24 PM
Macro for autofilter using variables declared in worksheet Jeff Excel Worksheet Functions 2 June 14th 05 03:38 AM
Problem with =sum(offset(cell reference,w,x,y,z). I want cell reference to be variable [email protected] Excel Worksheet Functions 2 December 11th 04 12:00 AM


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