Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default VBA Range Variables...

I have tried written the following code, however it's incorrect and I
can't seem to work out how to correct it. Could anybody offer any help
please?

Sub test()

Range("A1").Select
Dim Start As Range
Set Start = ActiveCell


Range("a5").Select
Dim Final As Range
Set Final = ActiveCell

Range (Start:Final).Select

End Sub

Many Thanks
Mark

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default VBA Range Variables...

Hi
you need a comma not a colon
Range(Start, Final).Select

the colon goes in the text address for the range
Range("A1:A5").Select

or even
Range(Start.Address & ":" & Final.Address).Select

regards
Paul

On Feb 15, 11:39 am, "MarkHear1" wrote:
I have tried written the following code, however it's incorrect and I
can't seem to work out how to correct it. Could anybody offer any help
please?

Sub test()

Range("A1").Select
Dim Start As Range
Set Start = ActiveCell

Range("a5").Select
Dim Final As Range
Set Final = ActiveCell

Range (Start:Final).Select

End Sub

Many Thanks
Mark



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 20
Default VBA Range Variables...

On 15 Feb, 11:48, wrote:
Hi
you need a comma not a colon
Range(Start, Final).Select

the colon goes in the text address for the range
Range("A1:A5").Select

or even
Range(Start.Address & ":" & Final.Address).Select

regards
Paul

On Feb 15, 11:39 am, "MarkHear1" wrote:



I have tried written the following code, however it's incorrect and I
can't seem to work out how to correct it. Could anybody offer any help
please?


Sub test()


Range("A1").Select
Dim Start As Range
Set Start = ActiveCell


Range("a5").Select
Dim Final As Range
Set Final = ActiveCell


Range (Start:Final).Select


End Sub


Many Thanks
Mark- Hide quoted text -


- Show quoted text -


Thank you for your help Paul!! :-)

Reply
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
Set few range variables at once Greg Excel Programming 4 November 15th 06 01:01 AM
Range of variables Ed Excel Programming 2 August 5th 06 03:05 PM
Describing a Range with Variables mazo Excel Programming 2 May 9th 06 02:28 PM
Excel Range Variables Alan[_30_] Excel Programming 6 March 13th 05 11:38 PM
Range Variables Daniel[_7_] Excel Programming 1 November 20th 03 05:45 AM


All times are GMT +1. The time now is 09:43 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"