Filter Number ("between") then return with some tagging

Megat91

New Member
Joined
Jul 9, 2020
Messages
12
Office Version
  1. 2010
Platform
  1. Windows
How to do VBA on filter the "Cost" collumn with some range
Example like "is greater than or equal to" = 2000 or "is less than or equal to" = -2000, return tag collum "Cost Group" with "< 2k" group
then so on like the picture outcome from yellow to green
btw, i will have different set of data with different number of rows each time doing

Thanks for the help
 

Attachments

  • Excel 1.JPG
    Excel 1.JPG
    106.6 KB · Views: 7

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Formula will do. Is it Ok.
In D3
Excel Formula:
=IF(C3=0,"",IF(ABS(C3)<1000,"<1k",IF(ABS(C3)<2000,">1K", ">2K")))
 
Last edited:
Upvote 0
But i need some VBA code, as i come from a very raw downloaded data to this kind of format arrangement, so thinking of inserting the VBA together with my previous step
 
Upvote 0
VBA code.
Assumed green column starts with D3
VBA Code:
Sub Macro2()
Dim LR As Long
'Assumed green column starts with D3
LR = Range("d" & Rows.Count).End(xlUp).Row
With Range("d3:d" & LR)
.Formula = "=IF(C3=0,"""",IF(ABS(C3)<1000,""<1k"",IF(ABS(C3)<2000,"">1K"", "">2K"")))"
.Value = .Value
End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,727
Members
449,049
Latest member
MiguekHeka

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