Some of my macro codes are recorded macros where I copy and paste. I have run into an issue where I will hit enter in a cell after running them and it will paste previously pasted info into that cell. To eliminate this I am bypassing the clipboard. I have been successful with codes that copy and paste a single cell but am unable to figure out how to do this with codes that copy and paste multiple cells.
Range("T2:T78").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Daily Calculator").Select
Range("k2").Select
Selection.End(xlToLeft).Select
ActiveCell.Offset(0, 1).Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
The sheet I am copying this code from is the "Calculator" sheet. I have other macros that need modified but am pretty sure if I see how one is supposed to be formatted I can alter the rest, except this next one.
Sub exporttojournal()
Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Dim Rng As Word.Range
Dim i As Integer
Set wrdApp = CreateObject("Word.Application")
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Open("C:\Users\Eli\Desktop\Journal.doc")
' sample word operations
With Sheets("Calculator")
Set rngWord = .Range("U1:X1", .Range("U1:X1").End(xlDown))
End With
rngWord.Copy
Set Rng = wrdDoc.Range
Rng.Collapse 0 'wdCollapseEnd
Rng.PasteExcelTable False, True, False
With wrdDoc
.Content.InsertAfter "E1RM-"
With Sheets("Calculator")
Set rngWord = .Range("R1")
End With
rngWord.Copy
Set Rng = wrdDoc.Range
Rng.Collapse 0 'wdCollapseEnd
Rng.PasteAndFormat (wdFormatPlainText)
.Content.InsertParagraphAfter
.Content.InsertAfter "Total Volume-"
With Sheets("Calculator")
Set rngWord = .Range("R2")
End With
rngWord.Copy
Set Rng = wrdDoc.Range
Rng.Collapse 0 'wdCollapseEnd
Rng.PasteAndFormat (wdFormatPlainText)
.Content.InsertParagraphAfter
.Content.InsertAfter "Average Intensity-"
With Sheets("Calculator")
Set rngWord = .Range("R6")
End With
rngWord.Copy
Set Rng = wrdDoc.Range
Rng.Collapse 0 'wdCollapseEnd
Rng.PasteAndFormat (wdFormatPlainText)
End With
With wrdDoc
.SaveAs ("C:\Users\Eli\Desktop\Journal.doc")
.Close ' close the document
End With
wrdApp.Quit ' close the Word application
Set wrdDoc = Nothing
Set wrdApp = Nothing
End Sub
Bookmarks