ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   InputBox (https://www.excelbanter.com/excel-programming/296761-inputbox.html)

Hargrove

InputBox
 
I'm having a heck of a time. I want my macro to que the user to input the file name before running.
Instead of always running MPA Agency.xls, I want to be able to replace Agency with Attorney or Internal etc..... (MPA and .xls always stay the same

Windows("MPA Agency.xls ").Activate "
Range("V1").Selec
Sheets(Array("All Roll-up", "PEL_Rev Summary", "AF DFS Summary", "ARP",
"Auto Finance", "BCS", "Commercial", "DDA", "Direct", "DFS", "FUHEB", "FUMC", "HEL",
"Lease", "TMS", "TMS-PEL", "W&T", "Revolving", "PEL")).Selec
Sheets("All Roll-up").Activat
Columns("V:W").Selec
Selection.Cop
Range("Z1").Selec
Selection.Insert Shift:=xlToRigh
Range("Z1").Selec
Sheets("All Roll-up").Select

david mcritchie

InputBox
 
Hi Hargrove,
I don't see InputBox in what you posted but perhaps you are
looking for a default (suggested) value in the InputBox prompt.
If so see examples in
http://www.mvps.org/dmcritchie/excel/inputbox.htm
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Hargrove" wrote in message ...
I'm having a heck of a time. I want my macro to que the user to input the file name before running.
Instead of always running MPA Agency.xls, I want to be able to replace Agency with Attorney or Internal etc..... (MPA and .xls

always stay the same)

Windows("MPA Agency.xls ").Activate ""
Range("V1").Select
Sheets(Array("All Roll-up", "PEL_Rev Summary", "AF DFS Summary", "ARP", _
"Auto Finance", "BCS", "Commercial", "DDA", "Direct", "DFS", "FUHEB", "FUMC", "HEL", _
"Lease", "TMS", "TMS-PEL", "W&T", "Revolving", "PEL")).Select
Sheets("All Roll-up").Activate
Columns("V:W").Select
Selection.Copy
Range("Z1").Select
Selection.Insert Shift:=xlToRight
Range("Z1").Select
Sheets("All Roll-up").Select




Tom Ogilvy

InputBox
 
sVar = "Attorney"

Windows("MPA " & svar & ".xls ").Activate

--
Regards,
Tom Ogilvy

"Hargrove" wrote in message
...
I'm having a heck of a time. I want my macro to que the user to input the

file name before running.
Instead of always running MPA Agency.xls, I want to be able to replace

Agency with Attorney or Internal etc..... (MPA and .xls always stay the
same)

Windows("MPA Agency.xls ").Activate ""
Range("V1").Select
Sheets(Array("All Roll-up", "PEL_Rev Summary", "AF DFS Summary",

"ARP", _
"Auto Finance", "BCS", "Commercial", "DDA", "Direct", "DFS",

"FUHEB", "FUMC", "HEL", _
"Lease", "TMS", "TMS-PEL", "W&T", "Revolving", "PEL")).Select
Sheets("All Roll-up").Activate
Columns("V:W").Select
Selection.Copy
Range("Z1").Select
Selection.Insert Shift:=xlToRight
Range("Z1").Select
Sheets("All Roll-up").Select





All times are GMT +1. The time now is 10:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com