Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Help Needed :( vidguru Excel Discussion (Misc queries) 0 April 4th 08 02:43 PM
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Macro needed to set macro security in Excel to minimum Carl Excel Programming 3 March 18th 06 03:36 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 02:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"