#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Macro

Please help

is there a way to run a command of macro that will delete the 1st 17
characters of a cell that is selected?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Macro

Maybe

Sub marine()
If Len(ActiveCell.Value) 16 Then
ActiveCell.Value = Mid(ActiveCell.Value, 18, Len(ActiveCell.Value) - 17)
End If
End Sub

Mike

"shifty" wrote:

Please help

is there a way to run a command of macro that will delete the 1st 17
characters of a cell that is selected?

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Macro

Thanks
Can you apply this to a range of cells when selecte in a column?




"Mike H" wrote:

Maybe

Sub marine()
If Len(ActiveCell.Value) 16 Then
ActiveCell.Value = Mid(ActiveCell.Value, 18, Len(ActiveCell.Value) - 17)
End If
End Sub

Mike

"shifty" wrote:

Please help

is there a way to run a command of macro that will delete the 1st 17
characters of a cell that is selected?

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro

If you have a column of this stuff, you could record a macro when you:

Select the range
Data|Text to columns
Fixed width
remove any lines that excel guessed, but add a line between character 17 and 18.

Choose to skip the first field

Choose general or text or whatever you want for the second field.

shifty wrote:

Please help

is there a way to run a command of macro that will delete the 1st 17
characters of a cell that is selected?

Thanks


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Macro

try this

Sub marine()
For Each c In Selection
If Len(c.Value) 16 Then
c.Value = Mid(c.Value, 18, Len(c.Value) - 17)
End If
Next
End Sub

Mike

"shifty" wrote:

Thanks
Can you apply this to a range of cells when selecte in a column?




"Mike H" wrote:

Maybe

Sub marine()
If Len(ActiveCell.Value) 16 Then
ActiveCell.Value = Mid(ActiveCell.Value, 18, Len(ActiveCell.Value) - 17)
End If
End Sub

Mike

"shifty" wrote:

Please help

is there a way to run a command of macro that will delete the 1st 17
characters of a cell that is selected?

Thanks

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
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 1 February 5th 07 09:31 PM
My excel macro recorder no longer shows up when recording macro jack Excel Discussion (Misc queries) 3 February 5th 07 08:22 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 06:08 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"