loop getting locked

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;

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
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,224,504
Messages
6,179,142
Members
452,892
Latest member
JUSTOUTOFMYREACH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top