Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi all,
I'm new to excel programming, and need help. I have this recorded macro and want to do 2 things with it now. 1st: I need to code so that I can let the user to select they own directories and file in text format, then open it in excel. 2nd: I need to save this macro as an add-in format with toolbar? Sub ImportGrant() ' ' ImportGrant Macro ' Macro recorded 12/22/2005 by aquach ' ' ChDir "C:\AQUACH\Excel Add-In" Workbooks.OpenText Filename:="C:\AQ\Excel Add-In\GrantTest.txt", Origin _ :=437, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 2), _ Array(3, 2), Array(43, 2), Array(45, 2), Array(55, 3), Array(64, 3), Array(73, 2), Array(84 _ , 2), Array(91, 2), Array(98, 2)), TrailingMinusNumbers:=True Rows("1:1").Select Selection.Insert Shift:=xlDown Range("A1").Select ActiveCell.FormulaR1C1 = "State" Range("B1").Select ActiveCell.FormulaR1C1 = "Client" Range("C1").Select ActiveCell.FormulaR1C1 = "Address" Range("D1").Select ActiveCell.FormulaR1C1 = "Phone#" Range("E1").Select ActiveCell.FormulaR1C1 = "Start" Range("F1").Select ActiveCell.FormulaR1C1 = "End" Range("G1").Select ActiveCell.FormulaR1C1 = "PO" Range("H1").Select ActiveCell.FormulaR1C1 = "Code" Range("I1").Select ActiveCell.FormulaR1C1 = "GS" Range("J1").Select ActiveCell.FormulaR1C1 = "Description" Range("K1").Select ActiveWorkbook.SaveAs Filename:="C:\AQ\Excel Add-In\Grant111405SFD.xls", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Create a macro to create excel line graph with coloured pointers anddata lables | Charts and Charting in Excel | |||
What is a macro, how to create and use it? | New Users to Excel | |||
Using a macro to create a macro in another workbook | Excel Worksheet Functions | |||
How do I create a Macro? | Excel Programming | |||
create macro | Excel Programming |