LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 410
Default Macro is very slow

I am trying to make a macro that will fill in this formula and then
remove the formula in these cells. It is a Vlookup formula that is
taken apart so I can change the columns to lookup. the lookup values
are coming from another sheet. Do go through each cell and select and
put in the formula takes forever. can anyone help me make this
faster?

Thanks,
Jay

Sub LSStuff()
Sheet1.Range("L4").Select
Dim SelRow, LastRow As Long
Dim String1, String2, String3 As String
String1 = "=VLOOKUP(L"
String2 = ",'G:\FI2_Share\Purchasing\Large sheet Lists\[LS
BOOK.xls]Large Sheets'!$B$10:$M$1066,"
String3 = ",FALSE)"
LastRow = Range("B65536").End(xlUp).Row

Do Until Selection.Row = LastRow
SelRow = Selection.Row

If Selection.Value = "" Then
Selection.Offset(1, 0).Select
Else
Selection.Offset(0, -2).Value = String1 & SelRow & String2
& 2 & String3
Selection.Offset(0, -2).Value = Selection.Offset(0,
-2).Value
Selection.Offset(0, -1).Value = String1 & SelRow & String2
& 3 & String3
Selection.Offset(0, -1).Value = Selection.Offset(0,
-1).Value
Selection.Offset(0, 1).Value = String1 & SelRow & String2
& 9 & String3
Selection.Offset(0, 1).Value = Selection.Offset(0,
1).Value
Selection.Offset(0, 2).Value = String1 & SelRow & String2
& 10 & String3
Selection.Offset(0, 2).Value = Selection.Offset(0,
2).Value
Selection.Offset(0, 3).Value = String1 & SelRow & String2
& 11 & String3
Selection.Offset(0, 3).Value = Selection.Offset(0,
3).Value
Selection.Offset(0, 4).Value = String1 & SelRow & String2
& 12 & String3
Selection.Offset(0, 4).Value = Selection.Offset(0,
4).Value
Selection.Offset(1, 0).Select
End If
Loop
End Sub
 
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
Macro Running Painfully Slow! bigV Excel Discussion (Misc queries) 5 May 31st 08 12:41 AM
Macro is amazingly SLOW...Need help anshu[_2_] Excel Discussion (Misc queries) 7 July 16th 07 01:03 PM
Excel 2007 VBA-XLL macro speed slow Konq Excel Discussion (Misc queries) 1 April 18th 07 02:18 AM
Why is this PageSetup Macro So Slow? [email protected] Excel Discussion (Misc queries) 6 July 19th 05 09:28 PM
Delay/Slow a Macro In Excel 2003 Kara Excel Worksheet Functions 1 February 11th 05 11:39 PM


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