ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   trying to determine where input goes (https://www.excelbanter.com/excel-programming/314780-trying-determine-where-input-goes.html)

Papa Jonah

trying to determine where input goes
 
I have a macro that uses an input box to ask the user for a date (to lookup).
The date is stored as mybegdate. I am using a lookup to find "mybegdate" in
the appropriate table. But it is not working. My guess is it doesn't
recognize mybegdate.
Is there a way to have mybegdate appear in a cell - that way I would know
that the value exists somewhere. Or maybe I am just referring to it
incorrectly in the lookup. This is my attempt to address my FY posting of a
couple of days ago.

My macros currently reads:
Range("z1").Select
mybegdate = InputBox("What date (MM/DD/YYY) will mark the beginning of the
review period?")
ActiveCell.FormulaR1C1 = "=mybegdate"
Range("z2").Select
ActiveCell.FormulaR1C1 = _
"=LOOKUP(" & mybegdate & ",'[Trending
Source.xls]Stats'!R14C1:R27C1,'[Trending Source.xls]Stats'!R14C2:R27C2)"

TIA


Frank Stone

trying to determine where input goes
 
hi,
computers are pretty stupid. you have to tell them
everything. so the code don't magicaly know where the
mythical place mybegdate is and mysteriously stick it
there when no one is looking. you have to TELL it where
mybegdate is. so the code should have some reference as to
where mybegdate is. if not then you may be right and the
code just don't know what to do with the variable, holds
it while the code is running and when the code ends, it
just dumps it into it's recycle bin.
mybegdate is a variable and only exist in memmory while
the code is running so you wont find it on any sheet.
best bet is to find it's reference in the code.

regards
Frank
-----Original Message-----
I have a macro that uses an input box to ask the user for

a date (to lookup).
The date is stored as mybegdate. I am using a lookup to

find "mybegdate" in
the appropriate table. But it is not working. My guess

is it doesn't
recognize mybegdate.
Is there a way to have mybegdate appear in a cell - that

way I would know
that the value exists somewhere. Or maybe I am just

referring to it
incorrectly in the lookup. This is my attempt to address

my FY posting of a
couple of days ago.

My macros currently reads:
Range("z1").Select
mybegdate = InputBox("What date (MM/DD/YYY) will mark the

beginning of the
review period?")
ActiveCell.FormulaR1C1 = "=mybegdate"
Range("z2").Select
ActiveCell.FormulaR1C1 = _
"=LOOKUP(" & mybegdate & ",'[Trending
Source.xls]Stats'!R14C1:R27C1,'[Trending Source.xls]

Stats'!R14C2:R27C2)"

TIA

.


Papa Jonah

trying to determine where input goes
 
How do I find reference it so that it is left in a cell?
My code defines it, but I don't know how to tell the computer to "place" it
into a cell.

"Frank Stone" wrote:

hi,
computers are pretty stupid. you have to tell them
everything. so the code don't magicaly know where the
mythical place mybegdate is and mysteriously stick it
there when no one is looking. you have to TELL it where
mybegdate is. so the code should have some reference as to
where mybegdate is. if not then you may be right and the
code just don't know what to do with the variable, holds
it while the code is running and when the code ends, it
just dumps it into it's recycle bin.
mybegdate is a variable and only exist in memmory while
the code is running so you wont find it on any sheet.
best bet is to find it's reference in the code.

regards
Frank
-----Original Message-----
I have a macro that uses an input box to ask the user for

a date (to lookup).
The date is stored as mybegdate. I am using a lookup to

find "mybegdate" in
the appropriate table. But it is not working. My guess

is it doesn't
recognize mybegdate.
Is there a way to have mybegdate appear in a cell - that

way I would know
that the value exists somewhere. Or maybe I am just

referring to it
incorrectly in the lookup. This is my attempt to address

my FY posting of a
couple of days ago.

My macros currently reads:
Range("z1").Select
mybegdate = InputBox("What date (MM/DD/YYY) will mark the

beginning of the
review period?")
ActiveCell.FormulaR1C1 = "=mybegdate"
Range("z2").Select
ActiveCell.FormulaR1C1 = _
"=LOOKUP(" & mybegdate & ",'[Trending
Source.xls]Stats'!R14C1:R27C1,'[Trending Source.xls]

Stats'!R14C2:R27C2)"

TIA

.




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com