Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default copy problem

I am trying to search all of column I for the values "---" (3 dashes)
when i find a match i want to replace whats in Ix with whats in Kx (x being
the row number)
then i want to put a 1 in Kx

I would like to loop through all of I to find the dashes.

Any help would greatly be appreciated
Mark


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default copy problem

One way:

Public Sub FindThreeDashesAndReplace()
Dim rFound As Range
With Columns("I")
Set rFound = Columns("I").Find( _
What:="---", _
LookIn:=xlValues, _
LookAt:=xlWhole, _
MatchCase:=False)
Do Until rFound Is Nothing
With rFound
.Value = .Offset(0, 1).Value
.Offset(0, 1).Value = 1
End With
Set rFound = .FindNext
Loop
End With
End Sub





In article news.atl.earthlink.net,
"Mark K" wrote:

I am trying to search all of column I for the values "---" (3 dashes)
when i find a match i want to replace whats in Ix with whats in Kx (x being
the row number)
then i want to put a 1 in Kx

I would like to loop through all of I to find the dashes.

Any help would greatly be appreciated
Mark


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default copy problem

Dim rng As Range
Set rng = ActiveSheet.Range("I1:I" &
UsedRange.Rows.Count)

Dim cell As Range
For Each cell In rng
If InStr(1, cell.Value, "---") < 0 Then
cell.Value = cell.Offset(0, 2).Value
cell.Offset(0, 2).Value = 1
End If
Next

-Brad
-----Original Message-----
I am trying to search all of column I for the values "---

" (3 dashes)
when i find a match i want to replace whats in Ix with

whats in Kx (x being
the row number)
then i want to put a 1 in Kx

I would like to loop through all of I to find the dashes.

Any help would greatly be appreciated
Mark


.

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
V-Look up copy problem-PLEASE HELP Sekhar Excel Worksheet Functions 3 September 12th 08 09:56 AM
Copy Problem WTG Excel Discussion (Misc queries) 3 March 23rd 07 10:14 PM
copy problem WTG Excel Worksheet Functions 2 March 23rd 07 09:50 PM
copy paste problem? Neil22 Excel Discussion (Misc queries) 5 January 10th 06 05:32 PM
Copy Problem [email protected] Excel Discussion (Misc queries) 6 August 11th 05 12:45 AM


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

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

About Us

"It's about Microsoft Excel"