I have the following code which will copy and paste various things from the Calculator sheet into the Journal sheet. In addition to that, I need Caclulator!R2:243 copied and pasted as values and transposed into the Data sheet, specifically into the table that starts at A1.
Thank you much!
Sub ExportExerciseStats() Dim sws As Worksheet, dws As Worksheet Dim lrow As Long Dim i '************* Dim response As VbMsgBoxResult response = MsgBox("Are you sure you want to export data as " & Range("AJ2").Text & " ?", vbCritical + vbYesNo + vbDefaultButton2, "Run Macro") If response = vbNo Then Exit Sub End If '***************** Set sws = ThisWorkbook.Worksheets("Calculator") Set dws = ThisWorkbook.Worksheets("Journal") Application.ScreenUpdating = False With dws.Range("A" & Rows.Count).End(xlUp) .Offset(2).Value = sws.Range("K8").Value .Offset(3).Value = sws.Range("K9").Value .Offset(4).Value = sws.Range("K10").Value lrow = sws.Range("X" & Rows.Count).End(xlUp).Row sws.Range("X2").Resize(lrow - 1, 5).Copy .Offset(5).PasteSpecial xlPasteValues .Offset(5).Resize(lrow - 1, 5).Borders.LineStyle = xlContinuous Application.CutCopyMode = False End With With sws.Range("AD10") For i = 0 To 3 If .Offset(i) <> "" Then dws.Range("A" & Rows.Count).End(xlUp).Offset(1) = .Offset(i) & "-" & .Offset(i, 1) End If Next End With sws.Range("X3").Resize(lrow - 2, 4) = "" Application.ScreenUpdating = True End Sub
Bookmarks