ADD Text to Cell Value // FILTERED Selection

NEW_2VBA

Board Regular
Joined
Dec 15, 2015
Messages
106
Hello! I'm sure this is an easy fix but I can't figure out how to change the code below to apply to visible cells only if user has selected cells within a filtered list.
It currently works however it updates all cells within a selected range, even cells not visible in a filtered list.

? I tried a few things (like adding SpecialCells(xlCellTypeVisible).Value) but it backfired & updated every cell in my workbook o_O (luckily it was a test workbook) lol! :LOL:


Dim c As Range
For Each c In Selection
If c.Value <> "" Then c.Value = "T&M to support unit costs: " & c.Value
Next

Thank you for your insight! ?
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Try
VBA Code:
 For Each c In Selection.SpecialCells(xlVisible)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,944
Messages
6,122,387
Members
449,080
Latest member
Armadillos

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