LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Run Code in Another Workbook

Sam - this helps. Thank you - Bob

"Sam Wilson" wrote:

The following looks for an open workbook called test.xls, finds a sheet
called "Sheet1" in it and colours cell A1 light blue. It can be placed in any
other workbook & will still work:

Sub demo()

dim wb as workbook
set wb = workbooks("test.xls")

dim ws as worksheet
set ws = wb.worksheets("Sheet1")

ws.range("A1").interior.colorindex = 37

end sub

You can use activeworkbook etc rather than setting wb to a pre-named
workbook etc.

Sam


"Bob Barnes" wrote:

Looking for automation code to have in a "Template" Workbook
that will run code in an Excel File received from Management.

This code would make a DBF from the Excel File received from Management.

TIA - Bob

 
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
How do I call up a line of code that references a cell/range in theactive workbook workbook where I am running my macro from? Lav Excel Programming 2 November 11th 08 05:04 PM
Code to change code in a sheet and workbook module Otto Moehrbach Excel Programming 11 November 11th 07 07:20 PM
run code on opening workbook and apply code to certain sheets Jane Excel Programming 7 August 8th 05 09:15 AM
Code in one workbook to call code in another XL file [email protected] Excel Programming 2 August 1st 05 03:37 PM
Reference code in another workbook from a calling workbook Datasort Excel Programming 1 January 4th 05 01:13 AM


All times are GMT +1. The time now is 12:45 AM.

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"