ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Command Buttons on Sheet moving with cells (https://www.excelbanter.com/excel-programming/283979-command-buttons-sheet-moving-cells.html)

Todd Huttenstine[_2_]

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

Chip Pearson

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




Greg Wilson[_4_]

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
.


Bob Phillips[_6_]

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




Todd Huttenstine[_2_]

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
.



All times are GMT +1. The time now is 12:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com