Help with InputBox

TsarMarkI

New Member
Joined
Aug 14, 2019
Messages
20
Hello Excel Gurus!

Hoping this is an easy one that I just can't figure out. I have values in Row 1 (such as "DSN" in A1, "Name" in B1, etc). I'm trying to build a macro where the input box prompts the user to enter in data into the inputbox, and that data goes into the open row below. For example, the text box would ask "What is the DSN", "What is the Name", etc based on the values in Row 1, and input that data into the corresponding cell in Row 2. Once they are finished, I would like to find a way for the macro to reset to the next open cell in Column A (Example: data is already in A2, so it begins putting data in A3.

I hope this makes sense- any help would be appreciated here!
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hello! Try this:
VBA Code:
Sub tmi()
Dim sh As Worksheet, lr&, c&, lc&, ib$
Set sh = ActiveSheet
    With sh
        lr = Cells(Rows.Count, 1).End(xlUp).Row
        lc = Cells(1, Columns.Count).End(xlToLeft).Column
   
        For c = 1 To lc
            ib = Application.InputBox("What is the " & Cells(1, c) & "?", , , , , , , 2)
            Cells(lr + 1, c).Value = ib
        Next c
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,975
Messages
6,122,538
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top