Putting dashes next to word to fill up space

angiemeh

Board Regular
Joined
May 2, 2007
Messages
181
Is there a Quick key comination that puts dashes next to a word to fill up the space for formatting purposes

- For example if I have three cells that I merge and then put the title 'Business Reveiw' in the cell and then center it, is there a way to put dashes before and after so that they are spaced without having to type them in? See Below

-----Business Review-----
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

ADAMC

Well-known Member
Joined
Mar 20, 2007
Messages
1,169
Office Version
  1. 2013
Platform
  1. Windows
Hi try a macro....?

Sub adddashes()
Dim WB As Workbook
Dim SH As Worksheet
Dim Rng As Range

Set WB = Workbooks("SAMPLE.xls") '<<==== CHANGE
Set SH = WB.Sheets("Sheet1") '<<==== CHANGE
Set Rng = SH.Range("A:AZ") '<<==== CHANGE

Rng.Replace What:="business review", _
Replacement:="---Business Review---", _
LookAt:=xlPart, _
SearchOrder:=xlByRows, _
MatchCase:=False
End Sub

This looks at SAMPLE.XLS
Sheet 1
range A:AZ and changes business review to ---business review---
It isnt case sensitive so will work whether upper or lower case or even both.

Hope it helps....

PS you can tailor the word it looks for and the word it is changed to if need be.
 

Forum statistics

Threads
1,181,362
Messages
5,929,534
Members
436,676
Latest member
Mavri

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
Top