dantheman9
Board Regular
- Joined
- Feb 5, 2011
- Messages
- 175
Hi Im try to conver the format of some data but running into issues so far i have the following, which currently gets stuck on the red marked code;
...OK its not the most effective vba in the world, but still learning the ropes!
Any help would be greatfully recivced on this or any other part of it!
Cheers
Dan
Code:
Sub splitimport()
'Work out interval gap between each name
Dim k As Integer
Dim j As Integer
Dim numbers As Integer
Dim Rrange As Range
Dim x As Integer
Range("B2").End(xlDown).Select
k = ActiveCell.Row - 1
' How many compeitors
Range("B6523").End(xlUp).Select
j = ActiveCell.Row
numbers = j / k
'Work out which data is split times
If (Range("C2").Value * 2) = Range("C3").Value Then
'MsgBox "true"
'Split is Time
ActiveSheet.Columns("E:E").Delete
ActiveSheet.Columns("A:A").Delete
Range("A1:D" & j + 1).Copy
Range("Sheet3!A1").PasteSpecial Paste:=xlPasteAll, Transpose:=True
Sheets("Sheet3").Activate
Range(Cells(1, 1), Cells(1, j)).Copy
Range("Sheet2!A2").PasteSpecial Paste:=xlPasteAll, Transpose:=True
Sheets("Sheet3").Activate
Range(Cells(2, 2), Cells(2, k)).Copy
Range("Sheet2!B2").PasteSpecial xlPasteAll
x = 2
Set Rrange = Range(Cells(3, x), Cells(4, x + k))
'ActiveCells.Copy
Do Until IsEmpty(Rrange.Value)
Rrange.Copy
Sheets("Sheet2").Activate
Range("B2665").End(xlUp).PasteSpecial Paste:=xlPasteAll
[COLOR=red]x = x + k[/COLOR]
Set Rrange = Range(Cells(3, x), Cells(4, x + k))
Loop
...OK its not the most effective vba in the world, but still learning the ropes!
Any help would be greatfully recivced on this or any other part of it!
Cheers
Dan