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

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
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.
 
Upvote 0

Forum statistics

Threads
1,214,870
Messages
6,122,019
Members
449,060
Latest member
LinusJE

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