
06-21-2012, 12:50 PM
|
|
Newcomer
|
|
Join Date: Jun 2012
Posts: 1
|
|
cut, paste, blank cell... problem
|
separate sign: $$$$
i have problem with data with empty cells (no telephone) or www.. to save empty space in next sheet
Code:
Sub szkajsigna()
Dim s As String, s2 As String, b As String, x As String
Dim Rng As Range, rCell As Range, signCounter As Integer
Set Rng = Range("A1:A500")
signCounter = rowCounter + 1
x = 1
For Z = 1 To 5
s = Cells.Find(What:="$$$$", After:=Cells(x, 1), LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlDown, MatchCase:= _
False, SearchFormat:=False).Row
s2 = Cells.Find(What:="$$$$", After:=Cells(s, 1), LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlDown, MatchCase:= _
False, SearchFormat:=False).Row
' MsgBox ("s=" & s & ", s2= " & s2)
x = s2 + 1
Set Rng = Range("A" & s, "A" & s2)
For i = s To s2
For Each rCell In Rng.Cells
If InStr(Cells(1 + i, 1).Value, "tel.") Then Sheets("Delay Duration").Range("B" & Rows.Count).End(xlUp).Offset(1) = rCell.Offset(0, 0)
' If InStr(rCell.Value, "www") Then Sheets("Delay Duration").Range("D" & Rows.Count).End(xlUp).Offset(1) = rCell.Offset(0, 0)
'If InStr(rCell.Value, "e-mail") Then Sheets("Delay Duration").Range("C" & Rows.Count).End(xlUp).Offset(1) = rCell.Offset(0, 0)
Next rCell
Next i
Next Z
End Sub
|
Last edited by Flyguy; 06-21-2012 at 02:39 PM.
|