LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default create an add-in from macro

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create a macro to create excel line graph with coloured pointers anddata lables anuj datta Charts and Charting in Excel 1 September 30th 09 04:04 PM
What is a macro, how to create and use it? ADNAN TEEJA New Users to Excel 2 August 6th 08 10:22 PM
Using a macro to create a macro in another workbook Gizmo63 Excel Worksheet Functions 2 May 15th 06 09:48 AM
How do I create a Macro? Dave Baden Excel Programming 1 June 17th 05 12:37 AM
create macro Todd[_5_] Excel Programming 1 August 8th 03 09:03 PM


All times are GMT +1. The time now is 05:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"