Pasting/Using Input Box Value

  • Thread starter Thread starter hindsight
  • Start date Start date
H

hindsight

I've got a sub that runs a series of calculations, many of which are
based off a "MonthEndDate."

Currently, I input a date (like 9/30/05) in cell D4 and the first line
of code is:

'This row will be used in many other calculations
Range("D4").Name = "MonthEndDate"

This works fine for me as I know that I've got to enter a date in cell
D4, but if someone else is using the spreadsheet they don't know that.

What I'd like to do is, when the sub runs, have an inputbox appear, the
user enters a date and that date is used in the calculations. I guess
that value has to be pasted somewhere in the workbook for the formulas
to work?

This is all I've got... as you can see I'm stuck
Sub test1()

Dim EndDate As Long
EndDate = InputBox("Enter the Month Ending Report Date.", "End
Date")

End Sub

Best,

JB
 
Sub testing()
Dim EndDate As Long
EndDate = InputBox("Enter The Month Ending Date", "End Date")
With Range("D4")
.Value = EndDate
.Name = "MonthEndDate"
End With
End Sub



Gord Dibben Excel MVP
 
Vacation & Gord,

Thanks for your reply's.

Gord - that's what I was looking for.

Vacation, I'll have to follow the link to check out Bruin's page.

Thanks again,

JB
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top