There is heaps of stuff about transposing on the board but I am more confused now.
My situation is:
There are 60 columns and 12000 rows.
The first 2 columns are conditional which are titled "Main Number" and "Sub Number"
The mail merge document will be populated from the row where there is a "Main Number" and the "Sub Number"=0.
So if "Main Number" Row 10 ="5" and "Sub Number" Row 10 ="0" then all the details in this row will be used.So far all OK.
BUT THE PROBLEM IS "Sub Number"(Column B) can have a value of 0,1 and 2.
So if ColumnA("Main Number") row 12="5" and Col B ("Sub")="1" then I need this row appended to Row 10.The data for type "0" stops at column 20,so the data for type"1" starts at column 21 and goes to col 40.
Same applies for data type 2 but goes to Col 60
If there is only 1 data type,ie 0 or 1 or 2 then there is no issue.This is the data sent.But if there is 0 and/or 1 and/or 2,then I'm stumped.
I have tried this formula but it does not work properly as once it finds a data type 2 it populates the other 2 cells when I copy my formula.
=IF(OR(B3=2),OFFSET(B3,0,30),IF(OR(B4=2),OFFSET(B4,0,30),IF(OR(B5=2),OFFSET(B5,0,30),"")))
I am using VBA at the moment but I need some assistance.Am i on the right track?
Code I have so far
Sub Copee()
Dim Currentcell, NextCell As Integer
Range("A2").Select
Currentcell = ActiveCell.Value
NextCell = ActiveCell.Offset(1, 0).Value
Do Until ActiveCell.Address = ("$A$1641")
Currentcell = ActiveCell.Offset(1, 0).Select
Currentcell = ActiveCell.Value
NextCell = ActiveCell.Offset(1, 0).Value
If Currentcell = NextCell Then
Currentcell = Selection.EntireRow.Copy
End If
Loop
End Sub
My situation is:
There are 60 columns and 12000 rows.
The first 2 columns are conditional which are titled "Main Number" and "Sub Number"
The mail merge document will be populated from the row where there is a "Main Number" and the "Sub Number"=0.
So if "Main Number" Row 10 ="5" and "Sub Number" Row 10 ="0" then all the details in this row will be used.So far all OK.
BUT THE PROBLEM IS "Sub Number"(Column B) can have a value of 0,1 and 2.
So if ColumnA("Main Number") row 12="5" and Col B ("Sub")="1" then I need this row appended to Row 10.The data for type "0" stops at column 20,so the data for type"1" starts at column 21 and goes to col 40.
Same applies for data type 2 but goes to Col 60
If there is only 1 data type,ie 0 or 1 or 2 then there is no issue.This is the data sent.But if there is 0 and/or 1 and/or 2,then I'm stumped.
I have tried this formula but it does not work properly as once it finds a data type 2 it populates the other 2 cells when I copy my formula.
=IF(OR(B3=2),OFFSET(B3,0,30),IF(OR(B4=2),OFFSET(B4,0,30),IF(OR(B5=2),OFFSET(B5,0,30),"")))
I am using VBA at the moment but I need some assistance.Am i on the right track?
Code I have so far
Sub Copee()
Dim Currentcell, NextCell As Integer
Range("A2").Select
Currentcell = ActiveCell.Value
NextCell = ActiveCell.Offset(1, 0).Value
Do Until ActiveCell.Address = ("$A$1641")
Currentcell = ActiveCell.Offset(1, 0).Select
Currentcell = ActiveCell.Value
NextCell = ActiveCell.Offset(1, 0).Value
If Currentcell = NextCell Then
Currentcell = Selection.EntireRow.Copy
End If
Loop
End Sub