Excel Macro Help: find, copy, transpose
Closed
Jay
-
Sep 4, 2008 at 05:44 PM
bhattjai Posts 1 Registration date Wednesday September 3, 2008 Status Member Last seen September 7, 2008 - Sep 7, 2008 at 08:57 PM
bhattjai Posts 1 Registration date Wednesday September 3, 2008 Status Member Last seen September 7, 2008 - Sep 7, 2008 at 08:57 PM
Related:
- Excel Macro Help: find, copy, transpose
- Spell number in excel without macro - Guide
- Excel mod apk for pc - Download - Spreadsheets
- Excel marksheet - Guide
- Kernel for excel - Download - Backup and recovery
- Macros in excel download free - Download - Spreadsheets
1 response
Dim cCell As Object 'Okay so what you need to do is create an object to work with the current cell so
Cells (1, "A").Select 'Then make sure you are starting at the very top so
For Each cCell In Range (Cells(1, "A"), Cells(1, "A").End(xlDown)) 'Then go through each cell in column A
If InStr(1, cCell.Value, "Defendant Address: ") > 0 Then ' Search for Defendant Address:
cCell.Offset(0, 1).Value = Mid(cCell.Value,19 , Len(cCell.Value)) 'copy name to next column cell
cCell.Offset(0, 2).Value = cCell.Offset(1,0).Value 'May need to increase as per how many rows gap between
. . . . .
End If
Next cCell
This should set you on your way, just need to add another IF block to catch the blank addresses fairly straight foward.
Cells (1, "A").Select 'Then make sure you are starting at the very top so
For Each cCell In Range (Cells(1, "A"), Cells(1, "A").End(xlDown)) 'Then go through each cell in column A
If InStr(1, cCell.Value, "Defendant Address: ") > 0 Then ' Search for Defendant Address:
cCell.Offset(0, 1).Value = Mid(cCell.Value,19 , Len(cCell.Value)) 'copy name to next column cell
cCell.Offset(0, 2).Value = cCell.Offset(1,0).Value 'May need to increase as per how many rows gap between
. . . . .
End If
Next cCell
This should set you on your way, just need to add another IF block to catch the blank addresses fairly straight foward.
Sep 7, 2008 at 08:57 PM