View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Claude Van Horn Claude Van Horn is offline
external usenet poster
 
Posts: 3
Default Adding Variables to a range with quotes

Thanks, Gary, but when I tried it I got a compile error 1004 " Method
'range' of object '_Global' failed" I thought it might have somethig to do
with the fact that I dimensioned the ChrtRange variable as a Golbal, so I
moved things around so the line was in the same subroutine that makes the
chart and dimentioned it as a Local. Then I coppied direct from your post
and formatted it as a single complete line (removing the "-" line split)
Same error. When I debug it, all the variables are correct in the statement
and pop up in the ToolTips and the Locals list, but there's something that
does not work in the range statement itself.

I too am using Excel 2003, so if it worked for you it should work for me. I
had hopes, I hadcommented out all the formats I had tried and yours was a
bit different from the other ones, so I had high hopes!

What now?

"Gary Keramidas" <GKeramidasAtMSN.com wrote in message
...
figured i'd give you the entire code to show how i did it

Sub test()
Dim xcol As String
Dim cltop As Long
Dim clbot As Long
xcol = "K"
cltop = 5
clbot = 8
Set chrtrange = Range("B" & cltop & ":B" & clbot & "," & xcol & cltop &
":" & _
xcol & clbot)

--

Gary Keramidas
Excel 2003