View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] simon@bucknall.org is offline
external usenet poster
 
Posts: 6
Default find and replace macro problem

Hi everyboby
I'm new to macro programing and am trying to write a simple, or so I
thought, replace macro in excel 2007.

I have two sheets on the same workbook one called "colour full" and
one called "colour"
Sheet "colour" contains a table with colour code and the coresponding
description. Sheet "colour full" contains a column of colour code
which i would like to replace with the description.

my problem seems to be in how to input the active cell value in to the
"Replace What:=" function and the active cell offset value in to the
"Replacement:=" function.

any help would be much apreciated as i have a lot of these replace
tasks to do



Sub colour()
'
' colour Macro
'
' Keyboard Shortcut: Ctrl+l
'
ActiveCell.Select
Sheets("colour full").Select
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.Replace What:=cell.Value,
Replacement:=cell.offset(0,-3)."Value", LookAt
:=xlPart, SearchOrder:=xlByRows, MatchCase:=False,
SearchFormat:=False, _
ReplaceFormat:=False
Sheets("colour").Select
ActiveCell.Offset(1, 0).Range("A1").Select
End Sub

Thanks
Simon