Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Do within an If statement

Hi, Tom Ogilvy gave me the following code, which works great. the
problem i have is that as it loops down it must check if the ActiveCell
is empty, if yes then do the Vlookup, if not then move one cell down to
the next empty cell.
My spreadsheet has +/- 5000 rows but must only apply the Vlookup to the
empty cells in column X.

Range("X1").Select
Do
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-23],LCS_Complete_E90.xls!C1:C12,2,0)"
ActiveCell.NumberFormat = "dd-mmm-yy"
activeCell.Offset(1,0).Select
Loop until isempty(activecell.offset(0,-23))

Could somebody please help me out of my misary ?

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Do within an If statement

Range("X1").Select
Do
if activecell.value = "" Then
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-23],LCS_Complete_E90.xls!C1:C12,2,0)"
ActiveCell.NumberFormat = "dd-mmm-yy"
End If
activeCell.Offset(1,0).Select
Loop until isempty(activecell.offset(0,-23))


--
HTH

Bob Phillips

"Tempy" wrote in message
...
Hi, Tom Ogilvy gave me the following code, which works great. the
problem i have is that as it loops down it must check if the ActiveCell
is empty, if yes then do the Vlookup, if not then move one cell down to
the next empty cell.
My spreadsheet has +/- 5000 rows but must only apply the Vlookup to the
empty cells in column X.

Range("X1").Select
Do
ActiveCell.FormulaR1C1 = _
"=VLOOKUP(RC[-23],LCS_Complete_E90.xls!C1:C12,2,0)"
ActiveCell.NumberFormat = "dd-mmm-yy"
activeCell.Offset(1,0).Select
Loop until isempty(activecell.offset(0,-23))

Could somebody please help me out of my misary ?

Tempy

*** Sent via Developersdex http://www.developersdex.com ***



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 203
Default Do within an If statement

Thanks Bob works a treat. Sorry for the time delay.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Do within an If statement

No problem, thanks for taking the time.

Regards

Bob

"Tempy" wrote in message
...
Thanks Bob works a treat. Sorry for the time delay.

Tempy

*** Sent via Developersdex http://www.developersdex.com ***



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
IF statement inside a SUMIF statement.... or alternative method Sungibungi Excel Worksheet Functions 3 December 4th 09 06:22 PM
Reconcile Bank statement & Credit card statement & accounting data Bklynhyc Excel Worksheet Functions 0 October 7th 09 09:07 PM
Embedding an OR statement in an IF statement efficiently Chatnoir11 Excel Discussion (Misc queries) 4 February 2nd 09 08:12 PM
Can an If statement answer an If statement? M.A.Tyler Excel Discussion (Misc queries) 2 June 24th 07 04:14 AM
appending and IF statement to an existing IF statement spence Excel Worksheet Functions 1 February 28th 06 11:00 PM


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