Show partial cell content and make the rest invisible

Lux Aeterna

Board Regular
Joined
Aug 27, 2015
Messages
191
Office Version
  1. 2019
Platform
  1. Windows
I'd like cell B1 to show only the first letter of its content, and make the rest of it invisible. I could use the LEFT function or hide content by using ****, but that's not what I need. I'd rather not use macros, as my file is already loaded.
 

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Is it static content or a formula?
 
Upvote 0
This can be achieved by changing the font color to white on all but the first letter...although likely easier done with VBA.
 
Upvote 0
It's actually several cells in B column. There's a macro that pastes data to those cells according to some criteria.

Their content differs in length, but it's always one word. So, I'm not sure how I could use the colour solution.
 
Upvote 0
You could add something to your code - for example:

VBA Code:
Sub HideAllButFirst()
   Dim targetRange As Range
   Set targetRange = Range("B2:B17") ' change as needed
   
   Dim cell As Range
   For Each cell In targetRange.Cells
      If Len(cell.Value) > 1 Then
         cell.Characters(2).Font.Color = vbWhite
      End If
   Next cell
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,810
Messages
6,121,690
Members
449,048
Latest member
81jamesacct

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