Insert Found Column

Guzzlr

Well-known Member
Joined
Apr 20, 2009
Messages
755
Code:
Set fnd = Range("8:8").Find("WBS", , , xlWhole, , , False, , False)
If Not fnd Is Nothing Then
    Intersect(Range("8:5000"), fnd.EntireColumn).Copy
    Range("B8").PasteSpecial xlPasteValues
    Intersect(Range("8:5000"), fnd.EntireColumn).ClearContents
End If
Hello
The code above is working well. However, how would I modify it so that instead of pasting as values, It would insert values in the Range of B8, which would drive all columns to the right.
Thanks for the help
 

Some videos you may like

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
42,786
Office Version
365
Platform
Windows
How about
Code:
Set Fnd = Range("8:8").Find("WBS", , , xlWhole, , , False, , False)
If Not Fnd Is Nothing Then
    Intersect(Range("8:5000"), Fnd.EntireColumn).Copy
    Range("B8").Insert xlToRight
    Intersect(Range("8:5000"), Fnd.EntireColumn).ClearContents
End If
 

Watch MrExcel Video

Forum statistics

Threads
1,102,552
Messages
5,487,525
Members
407,604
Latest member
sama9000

This Week's Hot Topics

Top