LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default Selective Data

This probably is not exactly what you wanted, but it was hard to tell exactly
what you wanted. I put in some test data as such:
0 20 Stan
10253 0 Joe
0 0 Ralph
101 0 0
102 21 Ralph
0 0 0
103 0 0
104 22 0
0 23 Stan
and then ran the following sub:
Sub myTest()
Dim ws As Worksheet
Dim StartRow As Integer, Finalrow As Integer
Dim TestVar As Variant, NewVar As String
Dim i As Integer, j As Integer
Dim Found As Boolean
Set ws = ThisWorkbook.Worksheets("sheet1")
StartRow = 1
Finalrow = ws.Range("a" & Rows.Count).End(xlUp).Row
For i = StartRow To Finalrow
NewVar = ""
Found = False
For j = 1 To 3
TestVar = ws.Cells(i, j).Value
If TestVar < 0 Then
NewVar = NewVar & " " & TestVar
Found = True
End If
Next j
If Found Then
ws.Cells(i, 4).Value = Trim(NewVar)
End If
Next i
End Sub
and ended up with this (which is possibly what you wanted:)
0 20 Stan 20 Stan
10253 0 Joe 10253 Joe
0 0 Ralph Ralph
101 0 0 101
102 21 Ralph 102 21 Ralph
0 0 0
103 0 0 103
104 22 0 104 22
0 23 Stan 23 Stan


"MattD" wrote:


That wasn't very well explained. I have a 3 columns of data containing
1000 rows. Each cell shows either a zero or a name of a case, case
number or a name of a person working a case. I desperately need a sub
or a formula to traspose all of the non zero data to another refined
cell range. Can anyone help?


--
MattD
------------------------------------------------------------------------
MattD's Profile: http://www.excelforum.com/member.php...o&userid=28405
View this thread: http://www.excelforum.com/showthread...hreadid=479965


 
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
Copying selective data leerem Excel Discussion (Misc queries) 3 August 3rd 08 04:41 PM
Formula to sum selective data. Anto111 Excel Discussion (Misc queries) 0 July 23rd 08 07:44 PM
Charting selective data Jael Excel Discussion (Misc queries) 8 November 22nd 07 04:17 AM
Selective graphing of data. goslings Charts and Charting in Excel 0 March 31st 07 09:38 AM
Charting Selective Data [email protected] Charts and Charting in Excel 6 February 23rd 07 06:56 AM


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