View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
timmulla timmulla is offline
external usenet poster
 
Posts: 46
Default help with a do while loop

It worked. Thanks for your help!
--
Regards,

timmulla


"Jim Thomlinson" wrote:

Are the cells you are checking actually empty or is there one or more blanks
in the cells? Try this...

Public Sub TEST10()

[M7].Select

Do While ActiveCell.Offset(0, -1).Value ""

If trim(ActiveCell.Value) = "" Then
ActiveCell.Value = "LBC04"

End If

ActiveCell.Offset(1, 0).Select

Loop

End Sub

--
HTH...

Jim Thomlinson


"timmulla" wrote:

Hi I was wondering if anyone could help me trouble shoot my code. I'm trying
to place specific text "LBC04" in blank cells using a Do While Loop to
determine the appropiate cells. I've used the following code successfully
numerous times, however, in this situation the "LBC04" is not being entered
into the cells. The Loop looks like it's working correctly, however, the
text just isn't being placed in the cells.


Can anyone see a problem with my code?

Public Sub TEST10()

[M7].Select

Do While ActiveCell.Offset(0, -1).Value ""

If ActiveCell.Value = "" Then
ActiveCell.Value = "LBC04"

End If

ActiveCell.Offset(1, 0).Select

Loop

End Sub
--
Regards,

timmulla