#1
|
|||
|
|||
Vlookup in VBA for new starter
I need help in creating a macro to do a Vlookup, I'm new at VBA & some assistance is greatly needed. I know how to do it in excel as a formula, but cannot get it to work in VBA. The problem I have is that I'm not using the same cell every time. My coding is as followed:
'Main Log Sheet ' rownum = Range("'Feedback'!E3").End(xlDown).Row + 1 'Data entered below Range("'Feedback'!E" & rownum) = "FB" & rownum Range("'Feedback'!F" & rownum).Formula = "=VLOOKUP(K & rownum,Users!A2:D110, 4, 0)" Range("'Feedback'!g" & rownum) = Now Range("'Feedback'!H" & rownum) = txtaccnum.Value All the rest work except for the Vlookup. I'm adding data into a sheet so the Vlookup will need to be looking at cell column k but a different number everytime & if possible, paste the value rather than the code in column F. Please help!!!!!!!!!!!! |
#2
|
|||
|
|||
have you tried: =Application.WorksheetFunction.VLookup(lookup_valu e, table_array,
col_index_num, [range_lookup]) |
#3
|
|||
|
|||
can you attach a sample worksheet and more details on how your code line should work? This way you will receive help faster and more precise...
|
#4
|
|||
|
|||
Thanks for the reply, will give it a try
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using Vlookup & IF together | thelauncher | Excel | 5 | 08-25-2013 11:32 PM |
Office 2010 Starter runs only for admins | jsussman | Office | 0 | 05-16-2011 10:32 AM |
Can i do this with a VLookup? | foodstudent | Excel | 1 | 01-21-2011 12:34 AM |
Using IF & VLOOKUP together | junction | Excel | 7 | 11-18-2010 05:15 AM |
Help with VLOOKUP | sakhtar | Excel | 2 | 07-24-2010 07:39 PM |