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

Is is possible to to set a range in VB and have any sub use it? If so how
would i be able to do this? Code so far

Set plane = Worksheets("Sheet1").Range("A98")

i want the range "plane" to be used throughout the worksheet.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default Setting A Range


Just pass the range as an argument in your sub...

Public Sub RangeDemo(r As Range)
Dim e As Variant 'every element in range
For Each e In r
MsgBox r.Value
Next
End Sub




"Reggie" schreef in bericht
...
Is is possible to to set a range in VB and have any sub use it? If so how
would i be able to do this? Code so far

Set plane = Worksheets("Sheet1").Range("A98")

i want the range "plane" to be used throughout the worksheet.



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
Excel Addin:Setting the range to the Excel.Range object range prop Rp007 Excel Worksheet Functions 5 November 24th 06 04:30 PM
VBA setting Range Jeff Excel Discussion (Misc queries) 1 December 2nd 05 07:36 PM
setting range().hidden=True causes range error 1004 STEVE BELL Excel Programming 6 September 2nd 05 02:16 AM
Setting a range when value is given ianripping[_101_] Excel Programming 3 August 31st 05 02:08 PM
Setting a range using VBA [email protected] Excel Programming 4 November 14th 03 05:16 AM


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