Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 237
Default Command Buttons on Sheet moving with cells

Hey guys,

I am using the following code supplied by Nigel that
autofits columns based on cell value. The problem is that
my command buttons also move with the movement of the
cells. How do I stop this?

Worksheets("Sheet1").Columns("A:IV").AutoFit
Thanx

Todd
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Command Buttons on Sheet moving with cells

Todd,

In the Format Control dialog, choose the Properties tab and
select either "Move but don't size with cells" or "Don't move or
size with cells".


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Todd Huttenstine" wrote in
message ...
Hey guys,

I am using the following code supplied by Nigel that
autofits columns based on cell value. The problem is that
my command buttons also move with the movement of the
cells. How do I stop this?

Worksheets("Sheet1").Columns("A:IV").AutoFit
Thanx

Todd



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 218
Default Command Buttons on Sheet moving with cells

Right click the command buttons and select Format Control
from the popup menu. Select the Properties tab and then
select the option button "Don't move or size with Cells".

Regards,
Greg

-----Original Message-----
Hey guys,

I am using the following code supplied by Nigel that
autofits columns based on cell value. The problem is

that
my command buttons also move with the movement of the
cells. How do I stop this?

Worksheets("Sheet1").Columns("A:IV").AutoFit
Thanx

Todd
.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Command Buttons on Sheet moving with cells

Todd,

Save the position beforehand, and restore it afterwards. Something like

Dim pos1 As Double

With Worksheets("Sheet2")
pos1 = .CommandButton1.Left
.Columns("A:IV").AutoFit
.CommandButton1.Left = pos1
End With

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Todd Huttenstine" wrote in message
...
Hey guys,

I am using the following code supplied by Nigel that
autofits columns based on cell value. The problem is that
my command buttons also move with the movement of the
cells. How do I stop this?

Worksheets("Sheet1").Columns("A:IV").AutoFit
Thanx

Todd



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 237
Default Command Buttons on Sheet moving with cells

Thanx, the format property worked well.


-----Original Message-----
Hey guys,

I am using the following code supplied by Nigel that
autofits columns based on cell value. The problem is

that
my command buttons also move with the movement of the
cells. How do I stop this?

Worksheets("Sheet1").Columns("A:IV").AutoFit
Thanx

Todd
.

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
Command buttons linked to moving rows steal_92 Excel Discussion (Misc queries) 2 June 11th 09 03:04 PM
Command Buttons on sheet changing sizes Dan Excel Discussion (Misc queries) 2 February 4th 09 02:36 PM
Putting Command Buttons on a Chart Sheet Kremlin Charts and Charting in Excel 2 May 11th 05 01:06 PM
Embedding command buttons in cells Andy Excel Programming 3 November 25th 03 11:37 PM
Control Buttons vs. Command Buttons Robert Gibson Excel Programming 1 October 13th 03 04:33 PM


All times are GMT +1. The time now is 10:47 PM.

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"