Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / July 2008

Tip: Looking for answers? Try searching our database.

Assigning cell value to range variable

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Raj - 31 Jul 2008 11:06 GMT
Hi,

Cell a1 of Sheet3 has the value : Worksheets("Parameters").Range("d4")

I want to assing this value to a range variable named rsprange.

I am using the statement:
Set rsprange = ThisWorkbook.Worksheets("Sheet3").Range("a1").Value

I am getting error message 424: Object Required.

Please help. I have the feeling this is something elementary that I am
not able to trouble-shoot.

Thanks in advance

Regards,
Raj

PS: I had posted this earlier today under the subject : Setting range
using vlookup. I am restating the problem after stripping extraneous
matter.
Dave Peterson - 31 Jul 2008 12:17 GMT
You're going to have to parse the contents of that cell to extract the worksheet
name and the address.

After you do that, you can use:

dim wksName as string
dim RngAddr as string
...some routine to parse those strings
set rsprange = thisworkbook.worksheets(wksname).range(rngaddr)

===
If I were you, I'd use two cells--one for the worksheet name and one for the
address of the cell.

with thisworkbook.worksheets("sheet3")
 set rsprange = thisworkbook.worksheets(.range("b1").value) _
                                   .range(.range("C1").value)
end with

Depending on what the name of that sheet and the address, it could make life
lots easier.

> Hi,
>
[quoted text clipped - 18 lines]
> using vlookup. I am restating the problem after stripping extraneous
> matter.

Signature

Dave Peterson

Raj - 31 Jul 2008 17:44 GMT
Dave,

Exactly the pointers I was looking for.

I have adopted the "If I were you" approach.

Thanks, once again.

Regards,
Raj

> You're going to have to parse the contents of that cell to extract the worksheet
> name and the address.
[quoted text clipped - 44 lines]
>
> Dave Peterson
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.