Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Macro for editing a series of cells

I am trying have a macro edit a series of cells automatically. Each cell is
the same format but has different information.

Basically I am trying to take a cell with a format of 0100 AM and have this
changed to 01:00 AM.

There is a large range of these cells thus the reason for wanting to
automate the insert of the colon.
--
Laddie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Macro for editing a series of cells

If the values are genuine times, you can just change the format. If not,
select the cells and run this small macro:

Sub colonize()
For Each r In Selection
v = r.Text
r.Clear
r.NumberFormat = "@"
r.Value = Left(v, 2) & ":" & Right(v, 5)
Next
End Sub


--
Gary''s Student - gsnu200820


"Laddie" wrote:

I am trying have a macro edit a series of cells automatically. Each cell is
the same format but has different information.

Basically I am trying to take a cell with a format of 0100 AM and have this
changed to 01:00 AM.

There is a large range of these cells thus the reason for wanting to
automate the insert of the colon.
--
Laddie

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Macro for editing a series of cells

Gary -

Thank you very much, it works like a charm...perfectly. I am far from a
programmer but have always been able to fight my way through Excel issues in
the past but this was one which was driving me crazy.

Can't thank you enough.... I owe you a beer.
--
Laddie


"Laddie" wrote:

I am trying have a macro edit a series of cells automatically. Each cell is
the same format but has different information.

Basically I am trying to take a cell with a format of 0100 AM and have this
changed to 01:00 AM.

There is a large range of these cells thus the reason for wanting to
automate the insert of the colon.
--
Laddie

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
editing chart series data w/ "keyboard only" (2007) J-Sep Charts and Charting in Excel 1 November 20th 09 05:53 PM
editing multiple cells with a macro lacy Excel Discussion (Misc queries) 1 May 22nd 09 02:36 PM
editing liked cells Roger Thompson Excel Discussion (Misc queries) 2 November 21st 06 06:28 PM
Need Help Editing Cells mike New Users to Excel 7 September 19th 06 08:56 AM
editing cells... jloberg Excel Programming 6 November 21st 03 06:54 PM


All times are GMT +1. The time now is 07:45 AM.

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

About Us

"It's about Microsoft Excel"