Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 34
Default Macro to remove last 4 characters from the contents of a cell.

We need to come up with a way to remove the last 4 characters from the
contents of a cell. I tried a macro, but wasn't sure how to make it go to
the next cell. For example, I select a cell, press end, backspace 4
positions and then hit enter. Works great for 1 cell! Is there a way to get
the macro to repeat all the way down the spreadsheet?

As always, Thanks for the help!

Ken
--
akkrug
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,441
Default Macro to remove last 4 characters from the contents of a cell.

Ken,

Select the cells and run this macro:

Sub Remove4()
Dim myCell As Range
For Each myCell In Selection
myCell.Value = Left(myCell.Value, Len(myCell.Value) - 4)
Next myCell
End Sub

HTH,
Bernie
MS Excel MVP


"akkrug" wrote in message
...
We need to come up with a way to remove the last 4 characters from the
contents of a cell. I tried a macro, but wasn't sure how to make it go to
the next cell. For example, I select a cell, press end, backspace 4
positions and then hit enter. Works great for 1 cell! Is there a way to get
the macro to repeat all the way down the spreadsheet?

As always, Thanks for the help!

Ken
--
akkrug



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remove Characters from a cell Kim Excel Worksheet Functions 8 June 1st 06 05:21 PM
how do i display cell contents greater than 255 characters in a t. Richard Lamey Excel Discussion (Misc queries) 1 February 13th 06 03:45 AM
how do I display cell contents when I am over 32, 767 characters? usdrmd Charts and Charting in Excel 1 November 21st 05 10:49 PM
remove last three characters of cell mira Excel Discussion (Misc queries) 8 July 28th 05 12:06 AM
Macro to remove contents of cell and move all other contents up one row adw223 Excel Discussion (Misc queries) 1 July 1st 05 03:57 PM


All times are GMT +1. The time now is 02:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"