Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2007

Tip: Looking for answers? Try searching our database.

VBA code for inactivating button

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Raj - 24 Jan 2007 05:36 GMT
Hi I want to know if somebdy can help me VBA code for inactivating a
button if the value of a particular cell say C1 is blank.

Example: On Sheet1 have a button "knowledge" and on clicking this
button a sheet2 opens which have two buttons K1 and K2. I want if value
of a particular cell say C1 (on Sheet1) is blank then K1 should become
inactive or is disabled, otherwise it should be active. Similarly if
cell C2 (on Sheet1) is a blank the button (K2 on Sheet2)) should be
should be inactive else it should be  active.

Hope i have made my question clear.

Regards
Raj
Corey - 24 Jan 2007 05:53 GMT
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("C1").Value = "" Then
K1.Enabled = False
Else
K1.Enabled = True
End If

If Range("C2").Value = "" Then
K2.Enabled = False
Else
K2.Enabled = True
End If

End Sub

Corey....

> Hi I want to know if somebdy can help me VBA code for inactivating a
> button if the value of a particular cell say C1 is blank.
[quoted text clipped - 10 lines]
> Regards
> Raj
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.