Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Accessing information from second workbook

I have a situation where I am trying to write a macro for work to handl
printing our schedules. We have a program that ouputs our dail
schedules in excel format, and I have written a macro that cleans i
up, sorts it, and color codes it.

The problem is that now I am looking to make it a better tool for th
less computer savvy members in my department. The macro is saved in
document called "Day-at-a-Glance Macro.xls" and contains instructions
as well as some individual table for customizing. One of thes
contains some employee names and the department they work in. Anothe
contains the color coding.

The macro is designed to work by opening both the macro document, an
the schedule data document, so the user can run the macro in the dat
document. I have been unable to loop through information in the macr
document for use in the data document.

Here is the code as I have it so far:

Dim wbkPth As String
wbkPth = "'[Day-at-a-Glance Macro.xls]Sheet1'!"
range(wbkPth & "D18").Activate
Do
row = ActiveCell.row
Call addDpt(first:=range(wbkPth & "D" & row).Value
last:=range(wbkPth & "E" & row).Value, dept:=range(wbkPth & "F"
row).Value)
ActiveCell.Offset(1, 0).Select
Loop Unti
IsEmpty(Excel.Workbooks(1).Worksheets(1).ActiveCel l.Offset(0, 1))

Can anyone help? Thank you very much :o)
-Nic

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Accessing information from second workbook

I have been working on this all weekend, and still haven't had any luck.
Any suggestions? Thank you very much

-Nick


---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Accessing information from second workbook

If the other workbook is name Book2.xls and has a sheet on it named sheet1,
then

msgbox workbooks("book2.xls").sheets("sheet1").range("a1" ).value

will display the value of cell A1 on that sheet. The following will also do
it:

msgbox workbooks("book2.xls").sheets("sheet1.cells(1,1).v alue

The use of Cells(row number, column number) is often easier to use if you
need to check a large number of cells:

For K = 1 to 5
msgbox workbooks("book2.xls").sheets("sheet1").cells(K, 1).value
Next

displays the values in 5 cells based on the value of variable K.

Robert Flanagan
Macro Systems
Delaware, U.S. 302-234-9857
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel


"randland " wrote in message
...
I have been working on this all weekend, and still haven't had any luck.
Any suggestions? Thank you very much

-Nick


---
Message posted from http://www.ExcelForum.com/



Reply
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
Accessing information from an encrypted file Ringside New Users to Excel 0 June 16th 08 04:13 PM
Prevent Username Accessing Workbook Martin Whitehead Setting up and Configuration of Excel 1 April 2nd 06 12:44 PM
accessing data from other workbook Tony Excel Programming 4 June 24th 04 12:38 PM
Accessing Closed Workbook Information Loomah Excel Programming 1 January 29th 04 01:45 PM
Accessing Closed Workbook Loomah Excel Programming 2 January 28th 04 12:11 PM


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