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


Hi all,

I have the following piece of script that brings up a prompt when
someone fills in a particular cell (in this case G10):

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
Select Case Sh.Name
Case "Programme"
Select Case Target.Address(0, 0)
Case "G10"
Range("G10").Activate
MsgBox "Now please fill in Component information"

End Select

End Select
End Sub

I want cells G5:G350 to behave in the same way, but when I change the
line:

Case "G10"

to

Case "G5:G350"

the script stops working. Can anyone suggest what I'm doing wrong and
how I might rectify this problem?

TIA,

SamuelT


--
SamuelT
------------------------------------------------------------------------
SamuelT's Profile: http://www.excelforum.com/member.php...o&userid=27501
View this thread: http://www.excelforum.com/showthread...hreadid=545027

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 216
Default Specifiying a Range

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
If Not Intersect(Targte, Range("G5:G350")) Is Nothing Then
If sh.Name = "Programme" Then
MsgBox "Now please fill in Component information"
End If
End If
End Sub


--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"SamuelT" wrote in
message ...

Hi all,

I have the following piece of script that brings up a prompt when
someone fills in a particular cell (in this case G10):

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
Select Case Sh.Name
Case "Programme"
Select Case Target.Address(0, 0)
Case "G10"
Range("G10").Activate
MsgBox "Now please fill in Component information"

End Select

End Select
End Sub

I want cells G5:G350 to behave in the same way, but when I change the
line:

Case "G10"

to

Case "G5:G350"

the script stops working. Can anyone suggest what I'm doing wrong and
how I might rectify this problem?

TIA,

SamuelT


--
SamuelT
------------------------------------------------------------------------
SamuelT's Profile:

http://www.excelforum.com/member.php...o&userid=27501
View this thread: http://www.excelforum.com/showthread...hreadid=545027



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 258
Default Specifiying a Range

Hi Samuel,

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As
Range)
Select Case Sh.Name
Case "Programme"
if not intersect(target,range("G5:G350")) is nothing then
Range("G10").Activate
MsgBox "Now please fill in Component information"
end if


End Select
End Sub

Probably you need also change "Range("G10").Activate". Let me know the
rule what cell should be activated.

Regards,
Ivan

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Specifiying a Range


Thanks guys - that's sorted it.

:) :) :

--
Samuel
-----------------------------------------------------------------------
SamuelT's Profile: http://www.excelforum.com/member.php...fo&userid=2750
View this thread: http://www.excelforum.com/showthread.php?threadid=54502

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
How do I enter formula sum(range+range)*0.15 sumif(range=3) tkw Excel Discussion (Misc queries) 2 October 1st 09 09:17 PM
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
Specifiying the worksheet name in a cell adiss Excel Worksheet Functions 2 April 28th 06 12:26 PM
Range.Find returns cell outside of range when range set to single cell Frank Jones Excel Programming 12 June 10th 04 04:22 AM
how to? set my range= my UDF argument (range vs. value in range) [advanced?] Keith R[_3_] Excel Programming 2 August 11th 03 05:55 PM


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