fari1
Active Member
- Joined
- May 29, 2011
- Messages
- 362
Code:
Sub findBalance()
Dim f As Range, fa As String, i As Long
Dim src As Worksheet, dst As Worksheet
Set src = Sheets("sheet2") 'sheet to be searched, change as required
Set dst = Sheets("sheet3") 'sheet for output, change as required
i = 2
With dst
.Range("A1") = "output"
Set f = src.Cells.Find(What:="CONSOLIDATED", After:=ActiveCell, LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not f Is Nothing Then
fa = f.Value
Do
If Len(f.Value) < 50 Then
.Cells(i, "A") = fa
i = i + 1
End If
Set f = src.Cells.FindNext(f)
Loop Until fa = f.Value
End If
End With
End Sub
hi, my above code is not giving as output those cells in which cell values are starting with the word balance e.g balance sheet, its only providing the cell address of the cells which contain the word balanace within it, e.g notes to balance sheet.
Also this code is just the providing the cell address for the values from column A, while i want it to loop through the whole worksheet, every column <!-- / message --><!-- sig -->