Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

clear part of item into multiple cells for column



I  have  this  code 

Sub clear_part()
   With Range("B2", Range("B" & Rows.Count).End(xlUp))
      .Replace " Purchase Order*", "", xlPart, , False, , False, False
   End With
End Sub

it  doesn't  work  anymore . should  clear  item contains Purchase Order for  each  cell in column B .

anybody  find out  what's  the  problem , please?



Selected Answer


Your code will clear all cells starting with a SPACE then "Purchase Order" (since the wildcard * will cover any text following that).

Suggest your remove the leading space or asterisk * in the " Purchase Order*"   part of your code.



thanks  for  this  note 
all   of  things  work  greatly ! 
leopard (rep: 70) Mar 31, '22 at 9:05 am
Add to Discussion

Answer the Question

You must create an account to use the forum. Create an Account or Login