[mso] Re: Excel 2000 - Use of Cell Formatting in Formula

Hi Ray & thank you

I'll give it a whirl later :-)

Your observations have convinced me not to give up my day job!!

Dave

----- Original Message ----- 
From: "Ray Blake" <ray@xxxxxxxxx>
To: <mso@xxxxxxxxxxxxx>
Sent: Friday, December 24, 2004 6:28 PM
Subject: [mso] Re: Excel 2000 - Use of Cell Formatting in Formula


> Wow, what a jumble!
>
> This should get you closer:
>
> Sub Worksheet_Change(ByVal Target As Range)
>    Dim rg As Range
>    Dim rgTarg As Range
>    Set rgTarg = Range("B:B,G:G,L:L,Q:Q,V:V")
>    Set rg = Intersect(rgTarg, Target)
>    If rg Is Nothing Then Exit Sub
>    If rg.Value = "B" Then
>        rg.Offset(1, 1).Resize(2, 1).Locked = True
>    End If
> End Sub
>
> Since the code sits in the sheet itself, you need to put this in each of
> the worksheets you want it to happen in.
>
> But you'll probably have to change it a bit. From your original post,
> you said it was an entry in column A which triggered the change, but you
> had it written so it was columns B,G,L,Q and V which triggered it.
>
> Ray
>
> ------------------------------------
> GR Business Process Solutions
> Ray Blake
> Head of Software Design
> ray@xxxxxxxxx
> Braedon
> Newell Road
> Hemel Hempstead
> Herts HP3 9PD
> tel: 01442 396518
> fax: 01442 389353
> mobile: 07834 226601
> ------------------------------------
>
>
> -----Original Message-----
> From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On
> Behalf Of David Lee
> Sent: 24 December 2004 17:28
> To: mso@xxxxxxxxxxxxx
> Subject: [mso] Re: Excel 2000 - Use of Cell Formatting in Formula
>
>
> Hi Ray - yes I know, it's Christmas Eve but.... :-)
>
> I have toyed with your script all day and got exactly no where! - this
> is
> what I've come up with, however, it doesn't work:
>
> Sub LockCells(ByVal Target As Range)
>    Dim rg As Range
>    Set rg = Intersect(Columns("B", "G", "L", "Q", "V").Value = B
>    If rg Is Nothing Then Exit Sub
>    Worksheets(Sheet1, Sheet3, Sheet5, Sheet7, Sheet9).rg.Offset(1, 1 +
> 1).Locked = True
> End Sub
>
> I'd be grateful for your comments but at your leisure, after all, it is
> Christmas Eve :-) but as you can see, I'm a pure novice at VB.
>
> Have youself a Merry Christmas and a happy New Year and thank you...
>
> Regards,
>
> Dave
>
> *************************************************************
> You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
> MicrosoftOffice@xxxxxxxxxxxxxxxx
>
> To send mail to the group, simply address it to mso@xxxxxxxxxxxxx
>
> To Unsubscribe from this group, send an email to
> mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) 
> in the subject line.
>
> Or, visit the group's homepage and use the dropdown menu.  This will also 
> allow you to change your email settings to digest or vacation (no mail).
> http://www.freelists.org/webpage/mso
>
> To be able to use the files section for sharing files with the group, send 
> a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an 
> invitation with instructions.  Once you are a member of the files group, 
> you can go here to upload/download files:
> http://www.smartgroups.com/vault/msofiles
> *************************************************************
> 


*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
http://www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: