ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Formatting to 2 decimal places, placing a page break and autofitting a collumn/row height (https://www.excelbanter.com/excel-programming/427528-formatting-2-decimal-places-placing-page-break-autofitting-collumn-row-height.html)

Sean Farrow

Formatting to 2 decimal places, placing a page break and autofitting a collumn/row height
 
Hi:
I need to do the following:
1. Format to a specific number of decimal places, where is this in the
active cell/selection?
2. Create a page break after the current cell/row.
3. Autofit a collumn/row to the data contained within.
Any help appreciated.
Sean.



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4035 (20090425) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com





Mike H

Formatting to 2 decimal places, placing a page break and autofitti
 
Hi,

I think you mean that if there is a (say) 3 in the activecell you want that
cell formatted to 3 decimal places, is that correct? If so try this

With ActiveCell
.NumberFormat = "0." & WorksheetFunction.Rept("0", ActiveCell.Value)
.EntireColumn.AutoFit
End With
ActiveWindow.SelectedSheets.HPageBreaks.Add befo=ActiveCell.Offset(1)

Mike

"Sean Farrow" wrote:

Hi:
I need to do the following:
1. Format to a specific number of decimal places, where is this in the
active cell/selection?
2. Create a page break after the current cell/row.
3. Autofit a collumn/row to the data contained within.
Any help appreciated.
Sean.



__________ Information from ESET NOD32 Antivirus, version of virus signature database 4035 (20090425) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com






Sean Farrow

Formatting to 2 decimal places, placing a page break and autofitti
 
Hi:
regarding the decimal places, I just want to format to 2 decimals, not the
number in the cell.
Any help appreciated.
Sean.
"Mike H" wrote in message
...
Hi,

I think you mean that if there is a (say) 3 in the activecell you want
that
cell formatted to 3 decimal places, is that correct? If so try this

With ActiveCell
.NumberFormat = "0." & WorksheetFunction.Rept("0", ActiveCell.Value)
.EntireColumn.AutoFit
End With
ActiveWindow.SelectedSheets.HPageBreaks.Add befo=ActiveCell.Offset(1)

Mike

"Sean Farrow" wrote:

Hi:
I need to do the following:
1. Format to a specific number of decimal places, where is this in the
active cell/selection?
2. Create a page break after the current cell/row.
3. Autofit a collumn/row to the data contained within.
Any help appreciated.
Sean.



__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4035 (20090425) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com






__________ Information from ESET NOD32 Antivirus, version of virus
signature database 4035 (20090425) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com






__________ Information from ESET NOD32 Antivirus, version of virus signature database 4042 (20090429) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com






All times are GMT +1. The time now is 02:15 AM.

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