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: 325
Default Referencing a range within a workbook

Good afternoon, all!

I have a workbook that uses a VBA routine to consolidate a number of other
workbooks into itself using the rough logic: open workbook to be consolidated
- copy data - return to consolidating workbook - paste data - return to
consolidated workbook - close - repeat as necessary for multiple files.

I want to be able to run some code ONLY if the value of a particular cell in
the Consolidator workbook doesn't equal a certain value.

The problem is I can't find the correct syntax to reference the range.
I have trapped the name of the consolidating workbook to a variable
"Consolidator WorkBookName" with ConsolidatorWorkBookName = ThisWorkbook.Name
and want to say something like:

If
Workbooks(ConsolidatorWorkBookName).sheets("Databa se").Range("TeamName").Formula < "Consolidating - please wait..." Then
ScreenReset
End If

but this gives me a "Type Mismatch"

Can anyone tell me where I'm going wrong?

I've tried to create a concatenated string that includes double quotes at
the beginning and the end of the workbook name, and stripping the ".xls" from
the end, but to no avail.

Thanks in advance

Pete
 
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
Referencing a named range based upon Range name entry in cell Barb Reinhardt Excel Worksheet Functions 14 June 20th 07 07:19 PM
referencing a named range from a closed workbook Gixxer_J_97[_2_] Excel Programming 4 April 8th 05 08:45 PM
VBA Referencing a Named Cell Range in another Workbook Frank & Pam Hayes[_2_] Excel Programming 5 June 29th 04 10:01 PM
referencing another workbook steve Excel Programming 0 May 7th 04 02:49 PM
Referencing a range from another workbook Tom Ogilvy Excel Programming 0 August 6th 03 03:36 PM


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