+ Reply to Thread
Results 1 to 7 of 7

Macro: inputbox query - Excel 2010

  1. #1
    Registered User
    Join Date
    06-27-2019
    Location
    Exeter, England
    MS-Off Ver
    2010
    Posts
    4

    Post Macro: inputbox query - Excel 2010

    Hi All,

    Firstly I have to say that I am definitely at beginner stage of Excel but do have a reasonable base knowledge of how to use it.

    I have been toying with Input Boxes and how I can use them efficiently for work.
    I am presently trying to create a functional worksheet to track feedback. This is broken down to 4 sections.

    Name
    Date
    Reference
    Reason

    I want the input box to request that information and to populate the cells on a worksheet, I have thus far created the Inputbox with the ability to ask the 4 questions and populate to 4 allocated cells. However I need it to populate down the sheet.

    The query I pose to you, is how can I create the inputbox to take the data and populate it down the work sheet so for example
    Name in A1 - Name data goes in A2 onwards
    Date in B1 - Date data goes in B2 onwards
    Reference in C1 - Ref data goes in C2 onwards
    Reason in D1 - Reason data goes in D2 onwards

    And all relevant data populates on all descending cells.

    I'm hoping I've made query clear, I have searched for about 1 hour for a resolution to no avail
    Last edited by KungFuFuzz; 06-28-2019 at 09:56 AM.

  2. #2
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Macro: inputbox query - Excel 2010

    Please Login or Register  to view this content.
    adapt for your input box codes. Finds next cell in column

  3. #3
    Registered User
    Join Date
    06-27-2019
    Location
    Exeter, England
    MS-Off Ver
    2010
    Posts
    4

    Re: Macro: inputbox query - Excel 2010

    Hi,

    Thanks so much for your response - so I have adapted the code and when it comes to that line it comes up:

    "Run-time error '9':
    Subscript out of range"

    I have noticed that upon saving the macro it removes the "+"

  4. #4
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Macro: inputbox query - Excel 2010

    Hi
    can you post the code you have - please use code tags as described

  5. #5
    Registered User
    Join Date
    06-27-2019
    Location
    Exeter, England
    MS-Off Ver
    2010
    Posts
    4

    Re: Macro: inputbox query - Excel 2010

    Quote Originally Posted by nigelog View Post
    Hi
    can you post the code you have - please use code tags as described
    Please not I am an absolute rookie with these.
    But the present code is:

    Private Sub CommandButton1_Click()

    Name = InputBox("Name")
    Range("A2").Value = Name
    Worksheets("Sheet1").Range("A2").End(xlDown).Row 1

    Reference = InputBox("RightNow")
    Range("B2").Value = Reference
    Worksheets("Sheet1").Range("B2").End(xlDown).Row 1

    Reason = InputBox("Reason")
    Range("C2").Value = Reason
    Worksheets("Sheet1").Range("C2").End(xlDown).Row 1

    End Sub

    I have also tried your formula as the last step only to be greeted with the same error

  6. #6
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Macro: inputbox query - Excel 2010

    Apologies

    try the following
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    06-27-2019
    Location
    Exeter, England
    MS-Off Ver
    2010
    Posts
    4

    Re: Macro: inputbox query - Excel 2010

    Quote Originally Posted by nigelog View Post
    Apologies

    try the following
    Please Login or Register  to view this content.
    Thank you so much, that is perfect

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] power query on os xp with excel 2010
    By JEAN1972 in forum Excel General
    Replies: 3
    Last Post: 04-02-2017, 10:39 AM
  2. [SOLVED] MACRO: If user clicks cancel in inputbox,then do nothing. Problem with inputbox appearance
    By Tona in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-05-2015, 04:33 AM
  3. Excel 2010 Query issues
    By bassam in forum Excel General
    Replies: 0
    Last Post: 06-23-2014, 03:37 AM
  4. Problem with InputBox and MsgBox in Search- Excel 2010
    By DKThib in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-27-2014, 12:21 PM
  5. Excel 2010 VBA Macro for linked object query in Hyperion essbase
    By excelfan123 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-15-2013, 12:06 AM
  6. macro does not record choice made drop-down list in a web-query - Excel 2010
    By rdesai in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-08-2012, 01:00 PM
  7. [Macro] Excel Query Connection with Inputbox for changing filters
    By JohnGaltnl in forum Access Programming / VBA / Macros
    Replies: 0
    Last Post: 07-19-2011, 04:24 AM

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