Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default finding cell with + and sorting

I have a range of T14:W29

Starting in T14 The values read across the rows T - U - V - W

A+ needs to keep the 20 and B needs to keep the 15, ect. The values are,
(with - separating the columns) for example:

T - U - V - W

A +2 - 20 - 15 - B

CD - 10 - 5 - E +4

B - 11 - 4 - J +9

YRB +6 - 3 - 7 - Q

What I need to do is identify the cells with the + and copy everything to an
new range starting at T38 so the end result looks like:

B - 15 - 20 - A +2

CD - 10 - 5 - E +4

B - 11 - 4 - J +9

Q - 7 - 3 - YRB +6

All of the cells that have a + in them need to be in "W" with their
corresponding numbers in "V"
All of the cells that have no + need to be in "T" with their corresponding
numbers in "U"

I hope I have explained this clearly enough.

Thanks'
CR


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default finding cell with + and sorting

Does this macro do what you want?

Sub MoveData()
Dim X As Long, Z As Long
Z = 38
For X = 14 To 29
If InStr(Cells(X, "T").Value, "+") Then
Cells(Z, "W").Value = Cells(X, "T").Value
Cells(Z, "V").Value = Cells(X, "U").Value
Cells(Z, "T").Value = Cells(X, "W").Value
Cells(Z, "U").Value = Cells(X, "V").Value
Z = Z + 1
Else
Range("T" & X & ":W" & X).Copy Range("T" & Z)
Z = Z + 1
End If
Next
End Sub

--
Rick (MVP - Excel)


"CR" wrote in message
m...
I have a range of T14:W29

Starting in T14 The values read across the rows T - U - V - W

A+ needs to keep the 20 and B needs to keep the 15, ect. The values are,
(with - separating the columns) for example:

T - U - V - W

A +2 - 20 - 15 - B

CD - 10 - 5 - E +4

B - 11 - 4 - J +9

YRB +6 - 3 - 7 - Q

What I need to do is identify the cells with the + and copy everything to
an new range starting at T38 so the end result looks like:

B - 15 - 20 - A +2

CD - 10 - 5 - E +4

B - 11 - 4 - J +9

Q - 7 - 3 - YRB +6

All of the cells that have a + in them need to be in "W" with their
corresponding numbers in "V"
All of the cells that have no + need to be in "T" with their corresponding
numbers in "U"

I hope I have explained this clearly enough.

Thanks'
CR


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default finding cell with + and sorting

Yes, it does.
Thank you!!


"Rick Rothstein" wrote in message
...
Does this macro do what you want?

Sub MoveData()
Dim X As Long, Z As Long
Z = 38
For X = 14 To 29
If InStr(Cells(X, "T").Value, "+") Then
Cells(Z, "W").Value = Cells(X, "T").Value
Cells(Z, "V").Value = Cells(X, "U").Value
Cells(Z, "T").Value = Cells(X, "W").Value
Cells(Z, "U").Value = Cells(X, "V").Value
Z = Z + 1
Else
Range("T" & X & ":W" & X).Copy Range("T" & Z)
Z = Z + 1
End If
Next
End Sub

--
Rick (MVP - Excel)


"CR" wrote in message
m...
I have a range of T14:W29

Starting in T14 The values read across the rows T - U - V - W

A+ needs to keep the 20 and B needs to keep the 15, ect. The values are,
(with - separating the columns) for example:

T - U - V - W

A +2 - 20 - 15 - B

CD - 10 - 5 - E +4

B - 11 - 4 - J +9

YRB +6 - 3 - 7 - Q

What I need to do is identify the cells with the + and copy everything to
an new range starting at T38 so the end result looks like:

B - 15 - 20 - A +2

CD - 10 - 5 - E +4

B - 11 - 4 - J +9

Q - 7 - 3 - YRB +6

All of the cells that have a + in them need to be in "W" with their
corresponding numbers in "V"
All of the cells that have no + need to be in "T" with their
corresponding numbers in "U"

I hope I have explained this clearly enough.

Thanks'
CR




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
Sorting - Finding last row WLMPilot Excel Programming 3 October 29th 08 09:34 PM
Excel Sorting - Finding Duplicate Entries Roxanne Excel Programming 1 January 16th 08 03:22 PM
finding, sorting, put only part of a cell Debilee Excel Worksheet Functions 4 October 10th 07 11:01 PM
Finding Duplicates in a Column (Without Sorting) ConfusedNHouston Excel Discussion (Misc queries) 3 February 14th 07 02:24 PM
Sorting and Finding data SamGB Excel Discussion (Misc queries) 1 May 25th 06 08:19 PM


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