+ Reply to Thread
Results 1 to 4 of 4

Pasting/Using Input Box Value

  1. #1
    Registered User
    Join Date
    02-19-2004
    Location
    St Louis, MO
    Posts
    13

    Talking Pasting/Using Input Box Value

    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

  2. #2
    Vacation's Over
    Guest

    RE: Pasting/Using Input Box Value

    See Ron de Bruin's Calendar control page at:

    http://www.rondebruin.nl/calendar.htm


    "hindsight" wrote:

    >
    > 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
    >
    >
    > --
    > hindsight
    > ------------------------------------------------------------------------
    > hindsight's Profile: http://www.excelforum.com/member.php...fo&userid=6360
    > View this thread: http://www.excelforum.com/showthread...hreadid=478963
    >
    >


  3. #3
    Gord Dibben
    Guest

    Re: Pasting/Using Input Box Value

    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


    On Mon, 24 Oct 2005 18:04:01 -0500, hindsight
    <[email protected]> wrote:

    >
    >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



  4. #4
    Registered User
    Join Date
    02-19-2004
    Location
    St Louis, MO
    Posts
    13
    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1