Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Works fine for me.
What do you have in M7 and L7? -- HTH Bob Phillips "timmulla" wrote in message ... 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Tinmulla,
Check that the blank cells rally are blank. Your experience is consistent, for example with cells that appear blank but, in fact, contain a leading space. --- Regards, Norman "timmulla" wrote in message ... 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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub fillempty_LBC04()
Selection.SpecialCells(xlCellTypeBlanks) = "LBC04" End Sub --- HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001] My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm Search Page: http://www.mvps.org/dmcritchie/excel/search.htm "timmulla" wrote in message ... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Advancing outer Loop Based on criteria of inner loop | Excel Programming | |||
Loop Function unable to loop | Excel Programming | |||
Problem adding charts using Do-Loop Until loop | Excel Programming | |||
Worksheet_Change - loop within a loop | Excel Programming | |||
HELP!!!! Can't stop a loop (NOT an infinite loop) | Excel Programming |