Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Activate button when row selected.

I have a button on a protected sheet which will allow the user to delete
a row. The button enabled feature is set to false initially. I would
like to enable the button when the user selects a row or multiple rows.
Then they can delete the selected rows & the sheet will be protected
again.

Any help on this would be greatly appreciated,

Regard's,
Johnnyb


---
Message posted from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Activate button when row selected.

Wouldn't this mean that you (Excel) would have to continually check to
see if anything has been selected on the worksheet?
I think it would be easier to always have the button ENABLED, and add
code as part of the deletion routine to check that the user has selected
valid and/or entire rows for deletion.

Sean
"Just press the off switch, and go to sleep!"

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Activate button when row selected.

right click on the sheet tab and select view code. Paste in code like
this:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = Target.EntireRow.Address Then
CommandButton1.Enabled = True
Else
CommandButton1.Enabled = False
End If
End Sub


--
Regards,
Tom Ogilvy

"Johnnyb " wrote in message
...
I have a button on a protected sheet which will allow the user to delete
a row. The button enabled feature is set to false initially. I would
like to enable the button when the user selects a row or multiple rows.
Then they can delete the selected rows & the sheet will be protected
again.

Any help on this would be greatly appreciated,

Regard's,
Johnnyb


---
Message posted from http://www.ExcelForum.com/



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Activate button when row selected.

Nice one Tom, Thanx

Tom Ogilvy wrote:
*right click on the sheet tab and select view code. Paste in cod
like
this:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = Target.EntireRow.Address Then
CommandButton1.Enabled = True
Else
CommandButton1.Enabled = False
End If
End Sub


--
Regards,
Tom Ogilvy

"Johnnyb " wrote in message
...
I have a button on a protected sheet which will allow the user t

delete
a row. The button enabled feature is set to false initially.

would
like to enable the button when the user selects a row or multipl

rows.
Then they can delete the selected rows & the sheet will b

protected
again.

Any help on this would be greatly appreciated,

Regard's,
Johnnyb


---
Message posted from http://www.ExcelForum.com/


--
Message posted from http://www.ExcelForum.com

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 activate an option button? Option Button Excel Discussion (Misc queries) 14 March 16th 09 10:28 PM
button in a cell to activate a macro alexfair Excel Worksheet Functions 6 May 30th 08 03:09 PM
How do I lock a radio button group if a N/A button is selected worry a lot Excel Discussion (Misc queries) 2 May 21st 05 08:33 PM
button to activate userform Virginia[_2_] Excel Programming 2 August 15th 04 10:27 PM
How to activate the button junx13[_3_] Excel Programming 1 June 10th 04 11:50 AM


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