ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA Find & Replace Intelligently (https://www.excelbanter.com/excel-programming/383701-vba-find-replace-intelligently.html)

David127

VBA Find & Replace Intelligently
 
Hello- I'm looking for a way of automating the replacement of a variable list
of numbers preceded by a name & then repeat until a blank space. For example:

Start With End With
Name1 Name1
33333 Name1
33334 Name1
33335 Name1
Name2 Name2
44444 Name2
44445 Name2
44466 Name2

Thanks in advance!

Charles Chickering

VBA Find & Replace Intelligently
 
Here's something simple to get you started, select the first cell with a name
in it, all cells to be replaced must be numbers only.
Sub ReplaceNumeric()
Do
If IsNumeric(ActiveCell) Then
ActiveCell.PasteSpecial xlPasteAll
Else
ActiveCell.Copy
End If
ActiveCell.Offset(1).Select
Loop Until ActiveCell = ""
End Sub
--
Charles Chickering

"A good example is twice the value of good advice."


"David127" wrote:

Hello- I'm looking for a way of automating the replacement of a variable list
of numbers preceded by a name & then repeat until a blank space. For example:

Start With End With
Name1 Name1
33333 Name1
33334 Name1
33335 Name1
Name2 Name2
44444 Name2
44445 Name2
44466 Name2

Thanks in advance!


David127

VBA Find & Replace Intelligently
 
This worked out great. Thanks!!!

"David127" wrote:

Hello- I'm looking for a way of automating the replacement of a variable list
of numbers preceded by a name & then repeat until a blank space. For example:

Start With End With
Name1 Name1
33333 Name1
33334 Name1
33335 Name1
Name2 Name2
44444 Name2
44445 Name2
44466 Name2

Thanks in advance!



All times are GMT +1. The time now is 01:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com