Hi VBA/Excel/IPhreeqcExperts,
I'm struggling to make this VBA script to work:
Sub sbCopyRangeToAnotherSheet()
LastColumn = ActiveSheet.UsedRange.Columns(ActiveSheet.UsedRange.Columns.Count).Columns
For n = 63 To 63
For i = n To n+20
Worksheets("Data").Activate
Worksheets("Data").Range(Cells(i, 45), Cells(i + 6, 54)).Copy
Worksheets("Example").Activate
Worksheets("Example").Range(Cells(63, 45), Cells(69, 54)).PasteSpecial xlPasteAll
Worksheets("Data").Activate
Worksheets("Data").Range(Cells(i, 45), Cells(i + 6, 54)).Copy
Worksheets("Data").Activate
Worksheets("Data").Range(Cells(i + 20, 45), Cells(i + 20, 54)).PasteSpecial xlPasteAll
RunPhreeqc
Worksheets("Output").Activate
Worksheets("Output").Range(Cells(2, 20), Cells(8, 29)).Copy
Worksheets("Data").Activate
Worksheets("Data").Range(Cells(i + 10, 45), Cells(i + 16, 54)).PasteSpecial xlPasteAll
Next i
'Application.ScreenUpdating = True
End Sub
I'm sorry I can't upload the Excel file as it is way too large for it to be posted on here. I really want to get it fixed, but I don't know how to. The results/data keeps overlapping the next set of data/results below, ruining the table/set of data/borders. Many thanks.
Bookmarks