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: 921
Default Working with Sheet references

I am trying to call to a second workbook, to a specific sheet, and a specific
range. The Hook here is that I want to select sheets based upon my if then
statements such that if cell B2 = "Rel 1a", then the code would jump to
Workbook "Release Plan (1,2,3,4).xls") and to Sheet = "Rel 1a" and select the
range =Range(xlApp.Cells(5, 6), xlApp.Cells(5, 26)). I cannot for the life of
figure out how to assemble the string. Could someone please point me in th
eright direction please.

Jeff
Dim Max As String
Dim Xlmonth As String
Dim ShtRef As String
Dim xlrange As Excel.Range
Dim Project As Object
Dim Page As Object
Dim Totals As Object

If xlApp.Range("B2") = "Rel 1a" Then ShtRef = "Rel 1a"
If xlApp.Range("B2") = "CIS Release 1B.Published" Then ShtRef = "Rel 1b"
If xlApp.Range("B2") = "CIS Release 2_IVR" Then ShtRef = "Rel 2 - IVR"
If xlApp.Range("B2") = "CIS Release 3 - Development.mpp" Then ShtRef =
"Rel 3 Estimated"

Project = xlApp.Windows("Release Plan (1,2,3,4).xls")
Page = xlApp.Worksheets(ShtRef)
Totals = xlApp.Range(xlApp.Cells(5, 6), xlApp.Cells(5, 26))
xlrange = (Project & Page & Totals)
xlrange.Select
 
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
Cell references not working RiteshB Excel Discussion (Misc queries) 2 August 12th 09 09:51 PM
Cell references stopped working Nick Krill Excel Discussion (Misc queries) 2 June 24th 06 09:23 PM
working with references of cells Diana Excel Worksheet Functions 1 April 9th 05 01:08 PM
External References not working right. Dread_Pirate_Roberts Excel Worksheet Functions 13 December 8th 04 11:07 PM
references between macros not working Papa Jonah Excel Programming 3 November 24th 04 07:07 PM


All times are GMT +1. The time now is 01:55 AM.

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

About Us

"It's about Microsoft Excel"