How to change this VBA to different columns

Romano_odK

Active Member
Joined
Jun 4, 2020
Messages
379
Office Version
  1. 365
Platform
  1. Windows
Good afternoon,

This code (again from Peter) works fine for my sheet. Its uses the 3rd column [Verkoopprijs] and checks the column next to it if the numbers are different. Now in the Table I have another set of columns next to each other that needs to be compared and filtered the same way, column [Kostprijs], column K (11th) and the one next to it. I can't seem to figure out how to change the code correctly. Who can help me?

Thank you for your time.


VBA Code:
With Range("Table_Query_from_A100[Verkoopprijs]")
    .Value = Evaluate(Replace("if(#=" & .Offset(, 1).Address & ",True,#)", "#", .Address))
  End With
  With Range("Table_Query_from_A100[#All]")
    .AutoFilter Field:=3, Criteria1:="TRUE"
'    If .Columns(1).SpecialCells(xlVisible).Count > 1 Then .Offset(1).Resize(.Rows.Count - 1).EntireRow.Delete
'    .AutoFilter Field:=3
  End With
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,215,558
Messages
6,125,511
Members
449,236
Latest member
Afua

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