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

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

zzydhf

Board Regular
Joined
Apr 10, 2002
Messages
236
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
 

rikrak

Active Member
Joined
Aug 21, 2002
Messages
255
Hi,
What about this:
<pre>
Sub AddMarietta()
ActiveCell.Value = ActiveCell.Value & "MARIETTA"
End Sub
</pre>
 

carusorm

New Member
Joined
Oct 15, 2002
Messages
2
THANKS THAT WORKED GREAT AND YOU MADE IT SO EASY. I HAVE SPENT THE MORNING TRYING TO DO THIS.
 

Forum statistics

Threads
1,144,510
Messages
5,724,786
Members
422,579
Latest member
Lekha mohanty

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