Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Replace Vlookup with a macro

I have a huge excel sheet being shared over the network the problem is that
when i run vlookup and save the file the file size goes very big. also the
data is really huge in these and its really inconvenient to run vlookup again
and again. i want to automate the process that when i open the workbook i
just run the macro and its done.

the current vlookup goes in cell c of worksheet 1 and compares A2 to whole
worksheet 2 and return cloumn 1 in cell c if its a exact match. this process
is sometimes hamper by spaces in which case it does not return a value. i
need a way to automatically delete all speace and html spaces also in sheet 1
column A .

Your help will be great and will save me plenty of time.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 510
Default Replace Vlookup with a macro

Hi Arain,

Adjust the following macro to your specific needs :

Sub Report()
Dim oCell As Range
Dim Dest As Range
For Each oCell In ActiveSheet.Range("A2:A10")
Set Dest =
Sheets("Sheet2").Range("A2:A10").Find(What:=oCell) .Offset(0, 1)
oCell.Offset(0, 2) = Dest.Value
Next oCell
End Sub


HTH
Cheers
Carim

Reply
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 and replace macro strange behaviour Nicawette Excel Discussion (Misc queries) 3 June 13th 06 08:49 PM
My first macro, uses Vlookup but doesnt update unless hit enter James Cornthwaite Excel Worksheet Functions 1 May 24th 06 10:01 PM
Creating a macro to find and replace text Louise Excel Worksheet Functions 10 June 8th 05 10:29 AM
Macro to delete and replace a text box Dave Excel Discussion (Misc queries) 0 February 24th 05 05:17 PM
macro to search and replace with offset Tim Excel Discussion (Misc queries) 5 December 11th 04 09:30 PM


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