LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Remove dashs from macro data


I want to remove the -'s from the value with the red arrow below. I
moves a number from one sheet to another. The format is like thi
555-55-555-5555 but I want the dashes removed when I click the macr
button:

Sub ORDER1()
Dim toWks As Worksheet
Dim actWks As Worksheet
Dim myRng As Range
Dim myCell As Range
Dim iRow As Long
Dim DestCell As Range

Set actWks = ActiveSheet
Set toWks = Worksheets("ORDER")

Set myRng = Intersect(Selection.EntireRow, actWks.Range("a:a"))

With toWks
Set DestCell = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0)
End With

With toWks
For Each myCell In myRng.Cells
iRow = myCell.Row
DestCell.Value = actWks.Cells(iRow, "a").Value
DestCell.Offset(0, 5).Value = actWks.Cells(iRow, "N").Value <==
DestCell.Offset(0, 11).Value = actWks.Cells(iRow, "F").Value
Set DestCell = DestCell.Offset(1, 0) '<<<changed
Next myCell
End With
End Su

--
Optitro
-----------------------------------------------------------------------
Optitron's Profile: http://www.excelforum.com/member.php...fo&userid=2672
View this thread: http://www.excelforum.com/showthread.php?threadid=56474

 
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 dashs from social security numbers Hemi Excel Discussion (Misc queries) 4 December 18th 08 10:48 PM
Help needed with Pivot table macro to remove data Nelly Excel Programming 1 June 10th 06 01:56 AM
Is there a macro to identify and remove duplicate data in Excel? Cindy Lou Excel Worksheet Functions 3 March 9th 06 03:10 AM
How do I Remove bullets from text data in Excel cell with macro? David McRitchie Excel Programming 0 September 19th 04 09:22 PM
Looping Macro to remove data where value is 0 Paul Excel Programming 3 January 10th 04 08:08 AM


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