GSWoodward
06-26-2009, 07:58 AM
I am using the following code. I want the output to be in txt format so i will not drop leading zeros.
Any help would be greatly appreciated
Sub Zozo()
' hard-coded: the place we start looking
nCol = 1
nRow = 2
' hard-coded: here's where we're sticking the output
dR = 7
dC = 4
rCi = 5
rC = rCi
prev = -1
While Not IsEmpty(Application.ActiveSheet.Cells(nRow, nCol))
cust = Application.ActiveSheet.Cells(nRow, nCol).Value
If (cust <> prev) Then
dR = dR + 1
prev = cust
rC = rCi
Application.ActiveSheet.Cells(dR, dC).Value = cust
End If
Application.ActiveSheet.Cells(dR, rC).Value = Application.ActiveSheet.Cells(nRow, nCol + 1).Value
rC = rC + 1
nRow = nRow + 1
Wend
End Sub
Any help would be greatly appreciated
Sub Zozo()
' hard-coded: the place we start looking
nCol = 1
nRow = 2
' hard-coded: here's where we're sticking the output
dR = 7
dC = 4
rCi = 5
rC = rCi
prev = -1
While Not IsEmpty(Application.ActiveSheet.Cells(nRow, nCol))
cust = Application.ActiveSheet.Cells(nRow, nCol).Value
If (cust <> prev) Then
dR = dR + 1
prev = cust
rC = rCi
Application.ActiveSheet.Cells(dR, dC).Value = cust
End If
Application.ActiveSheet.Cells(dR, rC).Value = Application.ActiveSheet.Cells(nRow, nCol + 1).Value
rC = rC + 1
nRow = nRow + 1
Wend
End Sub