Delete ref value from Column & adjacent value

Sleeplol

Board Regular
Joined
Apr 10, 2019
Messages
194
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hello,
I'm hoping I can get some help finishing this code

VBA Code:
Sub Remove_ListEnd()

    Dim vSpecificVal As Variant
    vSpecificVal = Worksheets("Obv_OI_TI").Range("A1").Value
    Call Worksheets("Obv_OI_TI").Range("F1:F1000").Replace(vSpecificVal, "")

End Sub

The above code will take the value from A1 (List End) and remove it from column F (the column with the fruit names). However, I need the adjacent cell also removed like the example below.
(Note: I can't simply remove the row because of other data on the sheet.

Example.png


Thanks for any help with this
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
try this:
VBA Code:
Sub Del()
Dim C As Range
Dim vSpecificVal As Variant
  vSpecificVal = Worksheets("Obv_OI_TI").Range("A1").Value
With Worksheets("Obv_OI_TI")
  With .Range("$F:$F")
   Set C = .Cells.Find(What:=vSpecificVal, LookIn:=xlValues, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False)
  End With
rowno = C.Row
colno = C.Column
.Range(.Cells(rowno, colno), .Cells(rowno, colno + 1)) = ""
End With
End Sub
 
Upvote 0
offthelip, this works fantastically!! Thanks very much
 
Upvote 0

Forum statistics

Threads
1,214,429
Messages
6,119,433
Members
448,897
Latest member
ksjohnson1970

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top