Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro example needed
I need a macro to do the following:
Read thru every row looking at a particluar column. When I find a certain text string in the column, extract another string from the column and place it in another column. Delete the string from the original column. Continue to last row. Can anyone give me an exapmle of a macro doing something similar? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro example needed
Kind of low on the details...
But maybe this'll give you a start. Option Explicit Sub testme01() Dim myCell As Range Dim myRng As Range Dim FirstStr As String FirstStr = "whatever" With Worksheets("sheet1") Set myRng = .Range("c1", .Cells(.Rows.Count, "C").End(xlUp)) End With For Each myCell In myRng.Cells If InStr(1, myCell.Value, FirstStr, vbTextCompare) 0 Then 'put some value in the same row, 6 columns to the right myCell.Offset(0, 6).Value = Mid(myCell.Value, 12) myCell.Value = Left(myCell.Value, 11) End If Next myCell End Sub mscertified wrote: I need a macro to do the following: Read thru every row looking at a particluar column. When I find a certain text string in the column, extract another string from the column and place it in another column. Delete the string from the original column. Continue to last row. Can anyone give me an exapmle of a macro doing something similar? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Help Needed :( | Excel Discussion (Misc queries) | |||
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort | Excel Worksheet Functions | |||
Macro needed to set macro security in Excel to minimum | Excel Programming | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) | |||
Macro needed to Paste Values and prevent Macro operation | Excel Discussion (Misc queries) |