I need help looping the following code to run until there is no data in column 3. right now the code only travels through row 193.
Code
Sub dist()
Range("C4:D4").Select
Selection.Copy
Sheets("Inverse Solution").Select
Range("C3").Select
ActiveSheet.Paste
Sheets("Point File").Select
Range("E4:F4").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Inverse Solution").Select
Range("C4").Select
ActiveSheet.Paste
For Row_counter = 7 To 194
Col_counter = 3
Sheets("Point File").Select
Set curCellinPoint = Worksheets("Point File").Cells(Row_counter, Col_counter)
curCellinPoint.Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Inverse Solution").Select
Range("G3").Select
ActiveSheet.Paste
Col_counter = Col_counter + 1
Sheets("Point File").Select
Set curCellinPoint = Worksheets("Point File").Cells(Row_counter, Col_counter)
curCellinPoint.Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Inverse Solution").Select
Range("H3").Select
ActiveSheet.Paste
Col_counter = Col_counter + 1
Sheets("Point File").Select
Set curCellinPoint = Worksheets("Point File").Cells(Row_counter, Col_counter)
curCellinPoint.Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Inverse Solution").Select
Range("G4").Select
ActiveSheet.Paste
Col_counter = Col_counter + 1
Sheets("Point File").Select
Set curCellinPoint = Worksheets("Point File").Cells(Row_counter, Col_counter)
curCellinPoint.Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Inverse Solution").Select
Range("H4").Select
ActiveSheet.Paste
Sheets("Inverse Solution").Select
Range("C5").Select
Application.CutCopyMode = False
Selection.Copy
Col_counter = Col_counter + 1
Sheets("Point File").Select
Set curCellinPoint = Worksheets("Point File").Cells(Row_counter, Col_counter)
curCellinPoint.Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Next Row_counter
End Sub
Display More