Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 07-27-2011, 02:48 PM
primmer3001 primmer3001 is offline Vlookup in VBA for new starter Windows 7 32bit Vlookup in VBA for new starter Office 2003
Novice
Vlookup in VBA for new starter
 
Join Date: Jul 2011
Posts: 5
primmer3001 is on a distinguished road
Default 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!!!!!!!!!!!!
Reply With Quote
  #2  
Old 08-16-2011, 08:36 AM
Catalin.B Catalin.B is offline Vlookup in VBA for new starter Windows Vista Vlookup in VBA for new starter Office 2007
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

have you tried: =Application.WorksheetFunction.VLookup(lookup_valu e, table_array,
col_index_num, [range_lookup])
Reply With Quote
  #3  
Old 08-19-2011, 05:32 AM
Catalin.B Catalin.B is offline Vlookup in VBA for new starter Windows Vista Vlookup in VBA for new starter Office 2007
Expert
 
Join Date: May 2011
Location: Iaşi, Romānia
Posts: 386
Catalin.B is on a distinguished road
Default

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...
Reply With Quote
  #4  
Old 08-19-2011, 06:48 AM
primmer3001 primmer3001 is offline Vlookup in VBA for new starter Windows 7 32bit Vlookup in VBA for new starter Office 2003
Novice
Vlookup in VBA for new starter
 
Join Date: Jul 2011
Posts: 5
primmer3001 is on a distinguished road
Default

Thanks for the reply, will give it a try
Reply With Quote
Reply



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
Vlookup in VBA for new starter 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

Other Forums: Access Forums

All times are GMT -7. The time now is 04:44 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft