lijon
09-10-2008, 10:03 AM
Hi folks... I'm trying to write a sub to do the following:
For each name in this B-column, try and find it in the G-column. If it's there, reformat the cell in G-column to be like B-column.
...but I'm stuck. Can anyone tell me where I'm coming up short?
Here's what I've got so far:
Dim names As Integer
Dim namey As String
Range("b7").Select
Selection.End(xlDown).Select
erow = ActiveCell.Row
srow = 7
For names = srow To erow
Range("B" & names).Select
namey = Range("b" & names).Value
Range("G7:G16").Select
Selection.Find(What:=(namey), After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Next names
Mucho gracias for all feedback and replies. The time is appreciated.
Lijon.
For each name in this B-column, try and find it in the G-column. If it's there, reformat the cell in G-column to be like B-column.
...but I'm stuck. Can anyone tell me where I'm coming up short?
Here's what I've got so far:
Dim names As Integer
Dim namey As String
Range("b7").Select
Selection.End(xlDown).Select
erow = ActiveCell.Row
srow = 7
For names = srow To erow
Range("B" & names).Select
namey = Range("b" & names).Value
Range("G7:G16").Select
Selection.Find(What:=(namey), After:=ActiveCell, _
LookIn:=xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False).Activate
Selection.PasteSpecial Paste:=xlPasteFormats, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
Next names
Mucho gracias for all feedback and replies. The time is appreciated.
Lijon.