LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Junior Member
 
Posts: 7
Default Can a excel macro be run from a .vbs file

Hi Guys

Can an excel macro be copied in to a .vbs script and run to (for example) format a .csv file?


EG, this script (to open book1.cvs and run this script??

Sub TrimTextRange()

Application.ScreenUpdating = False

Dim cell As Range, areaToTrim As Range
Set areaToTrim = Sheet1.Range("A1:H1000")
For Each cell In areaToTrim
cell.Value = Trim(cell.Value)
Next cell

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
Macro to Open excel file when file name is entered in cell K[_2_] Excel Programming 4 March 17th 09 12:12 AM
Excel '00, 1st file has macros, how to stop macro in 2nd file? kaptandrews Excel Discussion (Misc queries) 0 May 24th 06 03:07 PM
how can i call macro in powerpoint file from excel file pm[_2_] Excel Programming 3 January 6th 06 10:40 PM
Macro to save Excel file with date and time in the file name? sonic_d_hog Excel Programming 2 January 5th 06 05:57 PM
VBA Macro to copy an column from one Excel file into another file Sam Excel Programming 4 July 3rd 05 03:36 AM


All times are GMT +1. The time now is 09:49 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"