![]() |
find & replace help
How can I find cell A1 (all instances) in column C and replace them with cell B1, then automatically find cell A2 (in all instances) and replace them with cell B2, and so on until columns A and B are used up? I have tried the macro, but this gets me no where. Please help! Thanks, Jason ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
find & replace help
Jason,
Dim findCell As Range Set findCell = Range("A1") On Error Resume Next Do While Not IsEmpty(findCell) Columns("C").Replace findCell, findCell.Offset(0, 1), xlWhole Set findCell = findCell.Offset(1, 0) Loop On Error GoTo 0 Set findCell = Nothing The On Error statement takes care of the cases of when there are no matches. Kevin Beckham -----Original Message----- How can I find cell A1 (all instances) in column C and replace them with cell B1, then automatically find cell A2 (in all instances) and replace them with cell B2, and so on until columns A and B are used up? I have tried the macro, but this gets me no where. Please help! Thanks, Jason ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ . |
find & replace help
Thanks Kevin. How do I get started though? Is that VB script? Where do I input the command? I am really new to the advanced featues of Excel, but I am willing to learn. Do you have any good resources, books, etc., that you can point me to? Much apreciated, Jason ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
find & replace help
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm jasemhi wrote: Thanks Kevin. How do I get started though? Is that VB script? Where do I input the command? I am really new to the advanced featues of Excel, but I am willing to learn. Do you have any good resources, books, etc., that you can point me to? Much apreciated, Jason ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ -- Dave Peterson |
All times are GMT +1. The time now is 12:08 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com