LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default What am I doing wrong with this VBA range?

This works:

Dim myRange As Range

Set myRange = Worksheets("Collection").Range("H2:H4")

But the change below doesn't work for some reason and presents an error:

Dim refColumn As String
Dim myRange As Range

refColumn = "H"

Set myRange = Worksheets("Collection").Range(refColumn & "2:" &
refColumn & "4")


What have I done wrong?

Thanks in advance.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What is wrong with this range??? Geoff ML[_2_] Excel Programming 3 July 8th 08 07:38 PM
right code, wrong range Ray Excel Programming 2 March 22nd 07 02:13 PM
Range in wrong book Newbie Excel Programming 5 February 8th 07 02:38 PM
histogram, wrong input range Camilla Excel Discussion (Misc queries) 1 November 11th 05 07:21 AM
deleting wrong range! gavmer[_44_] Excel Programming 3 July 2nd 04 02:08 AM


All times are GMT +1. The time now is 11:49 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"