Home |
Search |
Today's Posts |
#2
![]() |
|||
|
|||
![]()
This should get you started. Press ALT+F11, double-click
on the ThisWorkbook module (if you don't see it, go to View Project Explorer), and paste in the code below. Press ALT+Q and save the workbook. Close and re-open. Option Explicit Sub Workbook_Open() Dim SheetNo As Long Dim sPrompt1 As String Dim sPrompt2 As String Dim dValuetoCell As Double Dim rTargetCell As Range Set rTargetCell = Range("A1") sPrompt1 = "Enter a number, 1-31:" sPrompt2 = "Enter value to " & _ "insert into cell " & _ rTargetCell.Address(False, False) & ":" SheetNo = Application. _ InputBox(prompt:=sPrompt1, Type:=1) Worksheets(SheetNo).Select dValuetoCell = Application. _ InputBox(prompt:=sPrompt2, Type:=1) ActiveSheet.Cells(rTargetCell.Row, _ rTargetCell.Column).Value = dValuetoCell End Sub --- Not much error-checking. If the user types in "32" on the first Inputbox, the code will error. HTH Jason Atlanta, GA -----Original Message----- I was wondering if someone could help me here. Im attempting to create an input box that will ask the user for a number and in turn use this number to identify a sheet , then take another input from the user and place it in a specific cell in the sheet specified in the first step. 1.i will create an excel file with 31 sheets 2.when user runs file he will get a popup box asking for sheet wanted 3.the user will input a number between 1-31 4.a new box will open asking for data (lets assume a number) 5.Excel will place this value in Sheet(x) and a preassigned cell Im very new to VBA so i apologise for the newbie post any help on this owuld be appreciated. Thank you . |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating custom list with a comma in it | Excel Discussion (Misc queries) | |||
Keep custom format in new worksheet | Excel Discussion (Misc queries) | |||
How to automate custom footer on all tabs | Excel Discussion (Misc queries) | |||
Creating custom colours in Excel 2002 | Excel Discussion (Misc queries) | |||
can you input time (hh:mm:ss) without having to input the colon i. | Excel Discussion (Misc queries) |