Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to compare the column widths between 2 sheets. If they differ one
of the sheets will have the column bordered in red using the borderaround method. However the button to initiate the comparison is on a third sheet and the border always appears on this sheet. Have tried activating the sheet prior to defining the range. Code as follows set myRange = worksheets("Name of sheet").Range(Cells(1, colNum), Cells(50, colNum)) does not work although the help suggests it should work. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
With worksheets("Name of sheet")
set myRange = .Range(.Cells(1, colNum), .Cells(50,colNum)) End With -- Regards, Tom Ogilvy "JLX" wrote in message ... I am trying to compare the column widths between 2 sheets. If they differ one of the sheets will have the column bordered in red using the borderaround method. However the button to initiate the comparison is on a third sheet and the border always appears on this sheet. Have tried activating the sheet prior to defining the range. Code as follows set myRange = worksheets("Name of sheet").Range(Cells(1, colNum), Cells(50, colNum)) does not work although the help suggests it should work. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom, still not sure why my syntax did not work but yours works fine.
Cheers John "Tom Ogilvy" wrote: With worksheets("Name of sheet") set myRange = .Range(.Cells(1, colNum), .Cells(50,colNum)) End With -- Regards, Tom Ogilvy "JLX" wrote in message ... I am trying to compare the column widths between 2 sheets. If they differ one of the sheets will have the column bordered in red using the borderaround method. However the button to initiate the comparison is on a third sheet and the border always appears on this sheet. Have tried activating the sheet prior to defining the range. Code as follows set myRange = worksheets("Name of sheet").Range(Cells(1, colNum), Cells(50, colNum)) does not work although the help suggests it should work. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
VBA setting range in another sheet | Excel Discussion (Misc queries) | |||
setting range().hidden=True causes range error 1004 | Excel Programming | |||
Help setting a print range in a data sheet | Excel Programming | |||
Help setting a print range in a data sheet | Excel Programming |