UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Range help needed...    
 
   
adaytay
post Jan 15 2007, 06:54 AM
Post #1

UtterAccess VIP
Posts: 3,656
From: Yorkshire, England.



Hi all,

Further to my last... having a few problems converting the lookup value to a range...

Here's what I have so far:

CODE
Application.WorksheetFunction.VLookup(sheets("Revised Data").cells(i,  1), Range("'[New Credit Control Register.xls]Data'!$A$1:$R$1430"), 18, 0)

I need to convert the first bit (Sheets("Revised Data").cells(i, 1)) to a range... but aren't sure of the syntax.

Can someone help?

Cheers,

Ad
Go to the top of the page
 
+
adaytay
post Jan 15 2007, 07:02 AM
Post #2

UtterAccess VIP
Posts: 3,656
From: Yorkshire, England.



Oh I am going to have to stop doing this...

It's always going to be the figure in column A, so I've replaced it with this:

Range("'Revised Data'!A" & i)

I must stop solving my own threads.... (IMG:http://www.utteraccess.com/forum/style_emoticons/default/laugh.gif) (IMG:http://www.utteraccess.com/forum/style_emoticons/default/laugh.gif) (IMG:http://www.utteraccess.com/forum/style_emoticons/default/laugh.gif)

Ad
Go to the top of the page
 
+
KingMartin
post Jan 15 2007, 07:43 AM
Post #3

Retired Moderator
Posts: 10,959
From: Prague,CZ / Kiev,UA



Hi Adam,

even if you autohelp yourself, still those threads may be useful to others... (IMG:http://www.utteraccess.com/forum/style_emoticons/default/sad.gif)

Martin
Go to the top of the page
 
+
adaytay
post Jan 15 2007, 08:05 AM
Post #4

UtterAccess VIP
Posts: 3,656
From: Yorkshire, England.



That's what I thought Martin (IMG:http://www.utteraccess.com/forum/style_emoticons/default/sad.gif)
Go to the top of the page
 
+
norie
post Jan 15 2007, 12:11 PM
Post #5

UtterAccess VIP
Posts: 4,308



Adam

The first argument in VlookUp in VBA is not a range.

It's the value to lookup, just like the worksheet function.
Go to the top of the page
 
+
adaytay
post Jan 16 2007, 11:53 AM
Post #6

UtterAccess VIP
Posts: 3,656
From: Yorkshire, England.



Actually... it has to be a range.

I tried it with the value but it needed to be converted to the range on the spreadsheet that contained the lookup value.

Ad
Go to the top of the page
 
+
NateO
post Jan 16 2007, 06:23 PM
Post #7

Remembered
Posts: 5,055
From: Minneapolis, MN, USA



Hi Ad,

The Find Method will return a Range:

http://msdn2.microsoft.com/en-us/library/a...office.11).aspx

(IMG:http://www.utteraccess.com/forum/style_emoticons/default/wink.gif)
Go to the top of the page
 
+
adaytay
post Jan 17 2007, 04:40 AM
Post #8

UtterAccess VIP
Posts: 3,656
From: Yorkshire, England.



Hey Nate (IMG:http://www.utteraccess.com/forum/style_emoticons/default/sad.gif)

Thanks for that - it's sorted now but that's worth remembering in case I need to do this again in the future!

Cheers,

Ad
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th June 2013 - 05:52 PM