Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Range with a variable

Hello there,

Can't understand why I can't find the solution to thins simple problem
anywhere.

Set d = Range("Year:" & c.Offset(-1, 0)).Find(Range("ReportYear"),
LookIn:=xlValues)

I don't know how to wright the syntax for a range which uses a variable. Must
be a common problem or? It workes when I do like this:
b = 1
Set d = Range("A" & b)
But when i want a range from "a" to "b" and use the symbol of ":" it doesn't
work.

Can someone help me please, I get an error all the time.
/Animal

--
Message posted via http://www.officekb.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 396
Default Range with a variable

Something like this?

Set d = Range("A" & b, "C" & f)

and b and f are numbers. CHange to suit.

--
Wigi
http://www.wimgielis.be = Excel/VBA, soccer and music


"Animal via OfficeKB.com" wrote:

Hello there,

Can't understand why I can't find the solution to thins simple problem
anywhere.

Set d = Range("Year:" & c.Offset(-1, 0)).Find(Range("ReportYear"),
LookIn:=xlValues)

I don't know how to wright the syntax for a range which uses a variable. Must
be a common problem or? It workes when I do like this:
b = 1
Set d = Range("A" & b)
But when i want a range from "a" to "b" and use the symbol of ":" it doesn't
work.

Can someone help me please, I get an error all the time.
/Animal

--
Message posted via http://www.officekb.com


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Range with a variable

Thank you very much it worked of course.

I had already tried it, but nothing happend and I found another problem for
that in a merged cell.

Take care

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200707/1

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
select range and put range address in variable [email protected] Excel Programming 2 January 25th 06 01:28 AM
Macro to copy a specified range to a variable range SWT Excel Programming 4 October 21st 05 08:24 PM
setting a range variable equal to the value of a string variable Pilgrim Excel Programming 2 July 1st 04 11:32 PM
Using Variable in RANGE Jim[_31_] Excel Programming 1 April 26th 04 01:26 PM
Problem trying to us a range variable as an array variable TBA[_2_] Excel Programming 4 September 27th 03 02:56 PM


All times are GMT +1. The time now is 10:17 AM.

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

About Us

"It's about Microsoft Excel"