Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Removing macro buttons from part of a sheet

Hi

the redoubtable DP (very helpfully) gave me this code to remove all
the buttons from a spreadsheet. In reality I want to restrict the
removal to buttons in Column A only. (there are 100+). Alternatively,
I want to remove all the buttons except for one in Column C. It may
sound odd but it is true!

Please can someone give me a start on revising the code

Thanks

Tim

Set CurWks = ActiveSheet

With CurWks
'Suppressed as it deletes the clear clipboard button
'.buttons.delete
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Removing macro buttons from part of a sheet

Name the one in col C and remove all except that name

"Tim Childs" wrote in message
om...
Hi

the redoubtable DP (very helpfully) gave me this code to remove all
the buttons from a spreadsheet. In reality I want to restrict the
removal to buttons in Column A only. (there are 100+). Alternatively,
I want to remove all the buttons except for one in Column C. It may
sound odd but it is true!

Please can someone give me a start on revising the code

Thanks

Tim

Set CurWks = ActiveSheet

With CurWks
'Suppressed as it deletes the clear clipboard button
'.buttons.delete



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Removing macro buttons from part of a sheet

Hi Don

Thanks for the post

Any chance of a bit more detail on the code too control
that deletion

Regards

Tim


-----Original Message-----
Name the one in col C and remove all except that name

"Tim Childs" wrote in message
. com...
Hi

the redoubtable DP (very helpfully) gave me this code

to remove all
the buttons from a spreadsheet. In reality I want to

restrict the
removal to buttons in Column A only. (there are 100+).

Alternatively,
I want to remove all the buttons except for one in

Column C. It may
sound odd but it is true!

Please can someone give me a start on revising the code

Thanks

Tim

Set CurWks = ActiveSheet

With CurWks
'Suppressed as it deletes the clear clipboard

button
'.buttons.delete



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,979
Default Removing macro buttons from part of a sheet

The following code deletes buttons in columns other than C:

Sub ClearButtons()
Dim CurWks As Worksheet
Dim btn As Button
Set CurWks = ActiveSheet

For Each btn In CurWks.Buttons
If btn.TopLeftCell.Column < 3 Then
btn.Delete
End If
Next
End Sub


Tim Childs wrote:
Hi Don

Thanks for the post

Any chance of a bit more detail on the code too control
that deletion

Regards

Tim



-----Original Message-----
Name the one in col C and remove all except that name

"Tim Childs" wrote in message
.com...

Hi

the redoubtable DP (very helpfully) gave me this code


to remove all

the buttons from a spreadsheet. In reality I want to


restrict the

removal to buttons in Column A only. (there are 100+).


Alternatively,

I want to remove all the buttons except for one in


Column C. It may

sound odd but it is true!

Please can someone give me a start on revising the code

Thanks

Tim

Set CurWks = ActiveSheet

With CurWks
'Suppressed as it deletes the clear clipboard


button

'.buttons.delete



.




--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default Removing macro buttons from part of a sheet

Hi

just the ticket!

THANKS

Tim

-----Original Message-----
The following code deletes buttons in columns other than

C:

Sub ClearButtons()
Dim CurWks As Worksheet
Dim btn As Button
Set CurWks = ActiveSheet

For Each btn In CurWks.Buttons
If btn.TopLeftCell.Column < 3 Then
btn.Delete
End If
Next
End Sub




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
Removing part of a cell Chad Portman Excel Discussion (Misc queries) 1 March 2nd 09 06:57 AM
Removing part(s) of text from downloaded data CAT Excel Worksheet Functions 14 December 11th 08 05:53 AM
Removing part of a number in Excel RISXRAY Excel Discussion (Misc queries) 3 September 13th 06 06:55 PM
removing part of text string to another cell jamie_k Excel Discussion (Misc queries) 2 July 24th 06 10:57 AM
removing part of a # Linny51 Excel Worksheet Functions 1 January 11th 05 04:21 PM


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