Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 2
Default Moving cell data left

Hi there, thank you in advance for any and all help.

In the attached wrkbook, you'll see columns with "##### - Name". I want to separate the two values (the numbers and the description) and move the numbers to column A. I have been using a macro to separate the cell data and was wondering if someone could help me insert a line for moving the (new separated) "#####" data to column A.


Thanks again!
Attached Files
File Type: zip Book1.zip (13.6 KB, 51 views)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default Moving cell data left

themiz wrote:

Hi there, thank you in advance for any and all help.

In the attached wrkbook, you'll see columns with "##### - Name". I want
to separate the two values (the numbers and the description) and move
the numbers to column A. I have been using a macro to separate the cell
data and was wondering if someone could help me insert a line for moving
the (new separated) "#####" data to column A.


Your file doesn't have anything in that format.

If the info is *always* in that format, rather than using Like, Split, etc.,
as in the code attached to that file (and also avoiding the need for 3
separate subs) I'd just do something like this:

Sub colNew()
Dim r As Range
For Each r In Range("D1:F" & _
Cells.SpecialCells(xlCellTypeLastCell).Row)
tmp$ = r.Value
where = InStr(tmp$, " - ")
If where Then
numpart = Left$(tmp$, where - 1)
namepart = Mid$(tmp$, where + 3)
Cells(r.Row, 1).Value = numpart
Cells(r.Row, 2).Value = namepart
End If
Next
End Sub

The targets for numpart and namepart will need to be verified by you.

--
If it requires a "C:" drive and it's not called "DOS",
then I don't need it.
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
Moving data left GM Excel Discussion (Misc queries) 4 October 7th 08 04:50 AM
Moving left of a cell reference jagbabbra Excel Worksheet Functions 1 June 13th 06 02:11 PM
Moving left of a cell reference jagbabbra Excel Worksheet Functions 0 June 13th 06 02:01 PM
Moving left/right from active cell Kurt Barr[_2_] Excel Programming 3 January 4th 06 05:30 PM
Moving Cell up, down, left or right thru Macros Mustafa S N Excel Programming 5 March 21st 05 01:09 PM


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