Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Queries in Macros
I have a macro which works perfectly. However, three lines of the macro
have to be changed to reflect the specifics of each file I'm working on. Is there a way to run the macro and have it pause at each of the three lines allowing me to input information. The three lines a Set ws1 = Sheets("Sheet1") '<<< Change Set rng = ws1.Range("A1:D45") FieldNum = 1 Thanks!! -- Message posted using http://www.talkaboutsoftware.com/gro...eet.functions/ More information at http://www.talkaboutsoftware.com/faq.html |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Queries in Macros
You can use an InputBox to pause and wait for user entry
Dim ws1 As String Dim rng As Range Dim FieldNum As Integer ws1 = InputBox("enter a sheet name") MsgBox "Sheetname is " & ws1 Set rng = Application.InputBox(prompt:= _ "Select a cell", Type:=8) MsgBox "Range selected is " & rng.Address FieldNum = InputBox("enter a number") MsgBox FieldNum Gord Dibben MS Excel MVP On Wed, 09 Apr 2008 08:27:30 -0500, "Lilbit" wrote: I have a macro which works perfectly. However, three lines of the macro have to be changed to reflect the specifics of each file I'm working on. Is there a way to run the macro and have it pause at each of the three lines allowing me to input information. The three lines a Set ws1 = Sheets("Sheet1") '<<< Change Set rng = ws1.Range("A1:D45") FieldNum = 1 Thanks!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Web Queries | Excel Discussion (Misc queries) | |||
web queries... | Excel Discussion (Misc queries) | |||
Web Queries | Excel Discussion (Misc queries) | |||
Queries | Excel Discussion (Misc queries) | |||
HOW DO I TRANSFER EXCEL SPREADSHEETS WITH QUERIES AND MACROS? | Excel Discussion (Misc queries) |