Solved: Pretty Simple VBA question

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

picklepuss

Thread Starter
Joined
Mar 25, 2010
Messages
8
I'm sure this is very simple, but since I am self-taught there are tremendous holes in my VBA knowledge.

I have a macro that does several things, including entering a second section on a spreadsheet (so the row location of that section's header will be variable). In the second section header, I need to define a cell for input box data to go into.

What is the best way for me to define a variable cell so that it becomes where the data from the input box (later in the macro) will go?

e.g. (this does not work but shows what I am looking for)
Dim DateCell As Range
ActiveCell = DateCell

**other stuff happens in macro**

Dim Dateinput As Date
Dateinput = InputBox ("What date is it? (m/d/yyyy)")
MyDate = Dateinput
Range("DateCell").Value = MyDate

Thanks for any help!!!
 

picklepuss

Thread Starter
Joined
Mar 25, 2010
Messages
8
Was able to solve myself -

Dim DateCell As String
DateCell = ActiveCell.Address

**other stuff**

Dim Dateinput, MyDate As Date
Dateinput = InputBox("What date is it? (m/d/yyyy)")
MyDate = Dateinput
Range(DateCell).Value = MyDate
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top