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

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
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,830
Messages
6,121,835
Members
449,051
Latest member
excelquestion515

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