ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   selecting columns to change format (https://www.excelbanter.com/excel-worksheet-functions/189809-selecting-columns-change-format.html)

mechi

selecting columns to change format
 
Hi!
I'm using Excel 2003 and VBScript.
I'm trying to change formats of specific columns. I get an error of
"missing Object" with the objRange. Is this the way to do it?


Set objRange = objWorksheet.Columns("D:E").Select
objRange.NumberFormat = "0.0000"

Set objRange = objWorksheet.Columns("B:B").Select
objRange.NumberFormat = "[$-1010409]d/m/yyyy h:mm;@"

Set objRange = objWorksheet.Cells("D1").Select
objRange.FormulaR1C1 = "=RC[-2]"

Set objRange = objWorksheet.Range("D").Select
objRange.FillDown

Thanks for any help!


Arvi Laanemets

selecting columns to change format
 
Hi

objWorksheet.Range("D:E").NumberFormat = "0.0000"
....

Arvi Laanemets


"mechi" wrote in message
...
Hi!
I'm using Excel 2003 and VBScript.
I'm trying to change formats of specific columns. I get an error of
"missing Object" with the objRange. Is this the way to do it?


Set objRange = objWorksheet.Columns("D:E").Select
objRange.NumberFormat = "0.0000"

Set objRange = objWorksheet.Columns("B:B").Select
objRange.NumberFormat = "[$-1010409]d/m/yyyy h:mm;@"

Set objRange = objWorksheet.Cells("D1").Select
objRange.FormulaR1C1 = "=RC[-2]"

Set objRange = objWorksheet.Range("D").Select
objRange.FillDown

Thanks for any help!





All times are GMT +1. The time now is 01:18 AM.

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