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: 16
Default macro to find the closest value

Hi all,
I am writing a program with vba and I need your help!
I need to find the closest value to a value enter by the user.
I have load values in column C, the user enter a value for the load. I need
to find the closest value in columns C and the corresponding value of voltage
that is in column G.
I need to do that in a macro, I tried vlookup but it doesn't work.. give me
type mismatch.
Here is the piece of code...

tabledata = Range(Worksheets("data").Cells(1, "C"),
Worksheets("data").Cells(lastrow, "G"))
finfat = Application.VLookup(finalprefat, tabledata, "G", True)

finalprefat is enter by the user....

Thanks for your help!
 
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
Find number closest to 0 snappertime Excel Discussion (Misc queries) 3 October 17th 08 02:56 AM
Array Lookup to Find Closest Date and Next Closest Date [email protected] Excel Worksheet Functions 7 November 7th 07 03:04 AM
Find the closest value Don Guillett Excel Programming 1 December 20th 06 05:25 PM
Find closest value Arne Hegefors Excel Programming 3 August 16th 06 03:01 AM
How do I find a column entry closest to a particular value feman007 Excel Discussion (Misc queries) 1 March 8th 05 10:22 PM


All times are GMT +1. The time now is 08:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"