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: 440
Default change cell value by code

I am trying to get the text value in cell D5 to alternate from "show dates"
to "hide dates" depending whether cols A-C (where the dates are) are visible
or not using the following:

Private Sub Worksheet_BeforeRightClick(ByVal Target As Range, Cancel As
Boolean)
'right clicking D5 will show/hide columns A-C (date, time and user name))
If Not Application.Intersect(Target, Range("D5")) Is Nothing Then
Columns("A:C").EntireColumn.Hidden = Not
Columns("A:C").EntireColumn.Hidden
==Target.Value = "hide dates": Target.Value = "show dates"<== this
bit pls!
Cancel = True
End If

I'm a bit stuck. Thanks

--
Traa Dy Liooar

Jock
 
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
Allow VBA code to change a locked cell?? Paul Kraemer Excel Programming 3 February 24th 10 04:49 PM
code to change color of negative cell [email protected] Excel Programming 1 October 2nd 07 03:48 PM
How to Run VBA Code on cell or range change Bob Phillips Excel Programming 2 December 10th 06 06:50 PM
How to Run VBA Code on cell or range change Dave Peterson Excel Programming 0 December 8th 06 12:05 AM
run code after cell contents change Brian Excel Programming 0 September 5th 03 08:37 PM


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