Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Range question

In the code below how can I make the range in the following line point to
the Worksheet named Sunday (cell B1000)?

If Range("B1000").Value = "xxx" Then


Private Sub Workbook_BeforeClose(Cancel As Boolean)


If Range("B1000").Value = "xxx" Then

Range("B1").Select
ThisWorkbook.Close False

Else: Range("B1").Select

End If
Range("B1").Select
Application.EnableEvents = True

End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Range question

Hi Patrick,

You can refer to that worksheet using the below line:

Thisworkbook.Worksheets("Sunday").Range("B1000").V alue

Hope that helps.

Regards,
James

"Patrick Simonds" wrote:

In the code below how can I make the range in the following line point to
the Worksheet named Sunday (cell B1000)?

If Range("B1000").Value = "xxx" Then


Private Sub Workbook_BeforeClose(Cancel As Boolean)


If Range("B1000").Value = "xxx" Then

Range("B1").Select
ThisWorkbook.Close False

Else: Range("B1").Select

End If
Range("B1").Select
Application.EnableEvents = True

End Sub



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
Range Question / error 1004: method Range of object Worksheet has failed Paul Excel Programming 3 April 7th 05 02:56 PM
range question CG Rosén Excel Programming 2 November 26th 04 02:21 PM
Range question mnewnam Excel Programming 0 October 28th 04 06:51 PM
Range question in VB rohnds Excel Programming 3 July 14th 04 09:51 AM
Range.Formula and Range question using Excel Automation [email protected] Excel Programming 0 September 19th 03 04:53 AM


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