Increasing the width/height of cells programatically

  • Thread starter Thread starter sameerce
  • Start date Start date
S

sameerce

Hi,
I have made an Excel VBA application where new sheets are automaticall
added on button click. I wanted to know how one can change the name o
the new excel sheet created and more importantly how does one chang
the width and height of cells in the new sheet.

Thanks,
Samee
 
Hi Sameer
Try and use the macro recorder.
Here's a sample code though:
Sheets.Add
ActiveSheet.Name = "Sheet11"
Rows("2:2").RowHeight = 20
Columns("B:B").ColumnWidth = 20

HTH
Cordially
Pascal
 
Try the following to change the whole worksheet column width and row heights


Sheets("Sheet1").Name = "YourName"
Cells.ColumnWidth = 15.5
Cells.RowHeight = 25.5

Cheers
Nigel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top