Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I would like to set the Style property of columns 3 & 4 of a range. These
columns are merged, and I can't figure out how to refer to that range. Right now, I'm using Range("tblTasks").Columns(3).Style = "Calculated Value" This gives me a Run-time error '450', "Wrong number of arguments of invalid property assignment". However, if I change the style reference to "Currency" or change the Columns(3) to Columns(2), it works. Can someone tell me what I'm doing wrong? Thanks, Matthew Pfluger |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this -
Range("tblTasks").Offset(, 3).Resize(, 2).Style = "Calculated Value" or, if tblTasks refers to cells in a single row Range("tblTasks").Columns(3).Mergearea.Style = "Calculated Value" Regards, Peter T "Matthew Pfluger" wrote in message ... I would like to set the Style property of columns 3 & 4 of a range. These columns are merged, and I can't figure out how to refer to that range. Right now, I'm using Range("tblTasks").Columns(3).Style = "Calculated Value" This gives me a Run-time error '450', "Wrong number of arguments of invalid property assignment". However, if I change the style reference to "Currency" or change the Columns(3) to Columns(2), it works. Can someone tell me what I'm doing wrong? Thanks, Matthew Pfluger |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The first suggestion didn't work. It returned a "Cannot change part of
merged cell" error. However, I took your work and changed it to: wksTaskSht.Range("tblTasks").Columns(3).Resize(, 2).Style = "Calculated Value" And that worked. Thanks for the shove in the right direction! Matthew Pfluger "Peter T" wrote: Try this - Range("tblTasks").Offset(, 3).Resize(, 2).Style = "Calculated Value" or, if tblTasks refers to cells in a single row Range("tblTasks").Columns(3).Mergearea.Style = "Calculated Value" Regards, Peter T "Matthew Pfluger" wrote in message ... I would like to set the Style property of columns 3 & 4 of a range. These columns are merged, and I can't figure out how to refer to that range. Right now, I'm using Range("tblTasks").Columns(3).Style = "Calculated Value" This gives me a Run-time error '450', "Wrong number of arguments of invalid property assignment". However, if I change the style reference to "Currency" or change the Columns(3) to Columns(2), it works. Can someone tell me what I'm doing wrong? Thanks, Matthew Pfluger |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Referring to columns from within a macro | Excel Discussion (Misc queries) | |||
Referring first row in range | Excel Programming | |||
Referring to non constant columns | Excel Programming | |||
referring to columns/cells using numbers | Excel Programming | |||
referring to a range | Excel Programming |