LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default worksheetfunction

hi,
i'm trying to use vlookup in vba, bt i can't get it to work. here's the thing:

Dim count As Integer
Dim n As Integer
Dim table As String
Dim look As String
Dim column As Integer

count = Workbooks("BDs").Worksheets("bd_lx").Range("A2").V alue
column = 3
For n = 4 To count
look = Workbooks("BDs").Worksheets("bd_lx").Range("B" & n).Value
table = Workbooks("BDs").Worksheets("bd_lx").Range("A" & n).Value

Application.WorksheetFunction.VLookup(look, rg, column, False).Select
Selection.Copy
Range("B:" & n).Select
Selection.End(xlRight).Select
ActiveCell.Offset(1, 0).Activate
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Next n

is it 'cause the variable array? and probably is not a range?
how can i put it right?

thanks a million,
 
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
WorksheetFunction help Ayo Excel Discussion (Misc queries) 2 July 20th 08 10:48 PM
Can't use WorksheetFunction Yossi Excel Discussion (Misc queries) 5 January 25th 06 10:07 PM
WorksheetFunction with VBA Ghislain Marcotte Excel Discussion (Misc queries) 2 February 13th 05 07:08 AM
Worksheetfunction MATCH Yves Janssens Excel Programming 2 October 6th 03 03:25 PM
Using Application.WorksheetFunction.Ln(...) in VBA doco Excel Programming 4 August 25th 03 01:08 PM


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