Excel VBA Macro: Find and Replace Values (Dynamic Range)

preview_player
Показать описание
Excel VBA Macro: Find and Replace Values (Dynamic Range). In this video, we create a macro with Excel VBA that finds a replaces any value in a range of data. We start off by writing code that determines the length of a set of data, then looks for a particular value in one column and replaces all instances of that value with another value. We then use the same find and replace function across multiple columns. Finally, we show that the replace function is case sensitive and can handle one or multiple characters in a string.

Data used in this video:

#ExcelVBA #ExcelMacro
Рекомендации по теме
Комментарии
Автор

Hi I wanted to get the countA of any column with visible rows data and wanted to exclude the hidden rows

manojgaidhankar
Автор

Hi Gregg. Thanks for the help. I tried your code with a wildcard and if did not seem to work. Did i miss something?

Set X = Range(Cells(3, 2), Cells(endrow, 2))
For Each Y In X.Cells
Y = Replace(Y, "*MAT*", "TUN")
Next Y

DouglasSubbs
Автор

How do I do it if I want to replace multiple values but with different words

annymedina
Автор

Can i put Y = Replace(Y, "<>S", "$") ? Basically try to change everything else but not the letter S. New to VBA thus im not sure how to go about this with my different set of data.

Batriderrenz
Автор

What happens if your column (A) has blank fields (Parent and Child SKU's for example?). When I ran this it replaced the values in the correct column C, but also in a column I didn't want included (Column B). How to prevent that? Also, how to get it to only find the exact value, so if I have d1 as a value it just finds that and replaces it but not if it's contained in another column with that value, ie, 001d100. Thanks

philipwall
Автор

how to do find & replace for multiple excel with multiple value?

SanjayGururao
Автор

What I should do if I have over 30 000 records and error: "Method 'End' of object 'Range' failed"?

dragonofie
Автор

How do I replace blank cells with "something". Actually Y = Replace(Y, "", "Something") this is not working

rakeshshamantula
welcome to shbcf.ru