PC Review


Reply
Thread Tools Rate Thread

How to define a range using variables

 
 
=?Utf-8?B?R2l2bmlr?=
Guest
Posts: n/a
 
      27th Jun 2007
How do I assign a range dynamically ie using a string variable, basically I
have a sheet that varies in the number of rows and I do a for next loop but
as yet have not worked out the syntax for how to use a variable in the Range
command... Range("x2:x10").Cells
Code so far

For Each cell In Range("x2:x10").Cells
If cell.PrefixCharacter = "'" Then
cell.Value = cell.Value
End If
Next cell

is it posisble to have something like:
strRange = "X2:X189"
For Each cell In Range(strRange).Cells

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamically define variables in VB.Net/ASP.Net SV Microsoft ASP .NET 3 21st May 2008 11:53 AM
RE: How to define a range using variables =?Utf-8?B?TWlrZSBI?= Microsoft Excel Programming 2 27th Jun 2007 11:30 AM
Using variables to define a range of cells? Matt Microsoft Excel Programming 2 24th Jul 2006 09:29 PM
How to use variables to define range Dolemite Microsoft Excel Programming 4 12th Aug 2005 06:57 PM
using variables to define range =?Utf-8?B?Z2luZ2Vybm9i?= Microsoft Excel Misc 1 17th Mar 2004 03:15 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:00 PM.