Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Loop never ends

Dear Useless,

Forget looping, do it directly. Something like this will work, though you
never said what your lookup formula actually was, so the .Formula line will
need to be adjusted: post back if you can't figure out the necessary
changes:

Sub MacroForUseless()
With Intersect(Columns("AC:AD"), ActiveSheet.UsedRange)
.AutoFilter Field:=1, Criteria1:="<"
With .Columns(2).SpecialCells(xlCellTypeVisible)
.Formula = _
"=VLOOKUP(A" & .Row & ",$B$1:$C$100,2,False)"
End With
.AutoFilter
End With
End Sub

HTH,
Bernie
MS Excel MVP

"useless at looping!" <useless at wrote
in message ...
I have a macro that I run every month which calculates commission and one

of columns in my spreadsheets uses vlookup. I would like the macro to paste
the vlookup command I am using into cells in column AD only if the cell in
column AC is not blank. I have tried creating loops but they either stop
after pasting into the first cell or continue on forever.

Anyone who can help? It would be greatly appreciated!!!



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
round up (ends with...) jatman Excel Worksheet Functions 3 August 30th 08 12:59 PM
filter using "ends with" and 3 choices? Ex: ends with 1,2 or3 Debbie Excel Worksheet Functions 1 April 6th 07 12:07 AM
Loop never ends Bob Phillips[_6_] Excel Programming 0 June 30th 04 06:55 PM
Loop never ends Anson[_2_] Excel Programming 0 June 30th 04 06:08 PM
Loop ends early BrianB Excel Programming 0 August 15th 03 12:13 PM


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