afoehrin
04-03-2009, 11:40 AM
Dear all,
Iīm trying to create a code to import for a new sheet the values of a centain cell with a condition. For example, i would like to import the value of cell A1 if B1 is fill with certain values (S, T1, T2, T3, T4). I thought in use the function "OR" but donīt know how to write than.
The code i wrote is:
...
For i = 8 To 55
If (cont = 0) Then
If (Cells(i, 28) = "S" Or "T1" Or "T2" Or "T3" Or "T4") Then
'copia status
Range("C" & i).Copy
ActiveWindow.ActivateNext
Range("D" & k).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.ActivateNext
...
Any suggestion to help me?
Thanks and a good Weekend to all
Alan
Iīm trying to create a code to import for a new sheet the values of a centain cell with a condition. For example, i would like to import the value of cell A1 if B1 is fill with certain values (S, T1, T2, T3, T4). I thought in use the function "OR" but donīt know how to write than.
The code i wrote is:
...
For i = 8 To 55
If (cont = 0) Then
If (Cells(i, 28) = "S" Or "T1" Or "T2" Or "T3" Or "T4") Then
'copia status
Range("C" & i).Copy
ActiveWindow.ActivateNext
Range("D" & k).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
ActiveWindow.ActivateNext
...
Any suggestion to help me?
Thanks and a good Weekend to all
Alan