[Excel] Macro to add prefix to column

[Closed]
Report
Posts
1
Registration date
Saturday August 25, 2012
Status
Member
Last seen
August 25, 2012
-
Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
-
Hi,

I recorded the following macro to add a thorn symbol before and after each record in a table. I can't figure out how to edit the macro so that it will work with a different set a data where there is a different amount of records. Help is much appreciated. Thanks.

Sub Macro6()

Range("A1:A26").Select
ActiveSheet.ListObjects.Add(xlSrcRange, Range("$A$1:$A$26"), , xlNo).Name = _
"Table9"
Range("Table9[#All,[Column1]]").Select
ActiveSheet.ListObjects("Table9").TableStyle = "TableStyleLight1"
Range("B1").Select
ActiveCell.FormulaR1C1 = "þ"
Range("C2").Select
ActiveCell.FormulaR1C1 = _
"=Table9[#Headers,[þ]]&[@Column1]&Table9[#Headers,[þ]]"
Range("C3").Select

End Sub>

1 reply

Posts
4476
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
August 2, 2020
768
Could you post on some public file sharing site, a sample work book and post back the link to the file back here. It would be easier to tell you answer if one has idea how your table may possibly look like