Get a macro to edit cells

carusorm

New Member
Joined
Oct 15, 2002
Messages
2
I need a macro to edit existing cells that contain text by going to the end of what's already in the cell and enter MARIETTA in it. It is probably something simple but everytime I try it the relative reference button grays out and the macro does not edit and add the text described above.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Welcome to the board!
Unless you hava a very large range, a formula in the next column would work (=a1&" Marietta"), copy down, then copy that column and paste special values over the current column.

However, here is a macro that will do it. It only works for cell with a text value. not numeric and not blank. Modify to suite...
Sub add_marietta()
Set RangeToCheck = Range("A1:c10")
For Each Cell In RangeToCheck
If IsNumeric(Cell) Then
ElseIf Cell.Value <> "" Then
Cell.Value = Cell.Value & " MARIETTA"
Else
End If
Next Cell
End Sub

HTH
 
Upvote 0
Hi,
What about this:
<pre>
Sub AddMarietta()
ActiveCell.Value = ActiveCell.Value & "MARIETTA"
End Sub
</pre>
 
Upvote 0

Forum statistics

Threads
1,214,651
Messages
6,120,739
Members
448,989
Latest member
mariah3

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