Hi,

I am using an existing macro for my daily reports that I need to tweak a little, but somehow I can't get VBA to do what needs to be done.
I've spent some time on internet, but can't really find the solution for my problem, so hoping you can help!


The report can vary in lenght and i am using this formula to determine the range:

Range("AC1").Formula = "=counta(A1:A100000)"
x = Range("AC1").Value

for all orders that are marked with "TYPE A" in column D, I need to include an instruction in our comments field (column X), however, this field may already contain some other text.

I decided to break this up into 2 bits.
The first IF/THEN is based on the comment field being blank. PART 1 one is working fine for me.
(just wanted to iclude it so you could see my report structure)


'PART 1 --> TYPE A orders marked with comments to cnclude return UPS label.
    Range("X2").Select
    For i = 2 To x
        If Range("D" & i).Value = "TYPE A" Then
            If Range("X" & i).Value = "" Then
                Range("X" & i).Value = "Please include return label."
            End If
        End If
    ActiveCell.Offset(1, 0).Select
    Next i

The 2nd IF/THEN contains an invalid instruction as I was unable to find the correct formula, so i just left the last attempt in there.
This IF/THEN needs to be based on the comment field (column X) NOT being blank.
I would prefer to have the instruction "Please include UPS return label. " to be included prior to whatever text may be in column X already.


'PART 2 --> TYPE A orders marked with comments to cnclude return UPS label for non-blank cells
    Range("X2").Select
    For i = 2 To x
        If Range("D" & i).Value = "TYPE A" Then
            If Not Range("X" & i).Value = "" Then
            Range("X" & i).Value = "Please include return label " & cell.Value
            End If
        End If
    ActiveCell.Offset(1, 0).Select
    Next i


any help with PART 2 would be appreciated!
Thanks!!