Hello, I have a macro that i have been using for a couple of years. It is written as an Excel macro, but worked well with LO 5.4. When I went to LO 6.0, it quit working correctly. This is the code I used:
Rem Attribute VBA_ModuleType=VBAModule
Option VBASupport 1
Sub Monday()
' Print Monday's Assignments
'
' Copy and paste
Set rngCopy = Sheets(ActiveSheet.Name).Range("CA4:CE38")
Set rngPaste = Sheets(ActiveSheet.Name).Range("AW4")
rngCopy.Copy
rngPaste.PasteSpecial xlPasteValues
rngPaste.PasteSpecial xlPasteFormats
Set rngPaste = Sheets(ActiveSheet.Name).Range("BC4")
rngPaste.PasteSpecial xlPasteValues
rngPaste.PasteSpecial xlPasteFormats
Set rngPaste = Sheets(ActiveSheet.Name).Range("BI4")
rngCopy.Copy
rngPaste.PasteSpecial xlPasteValues
rngPaste.PasteSpecial xlPasteFormats
' Make as many copies as specified in F1
Set MyRange = Range("AW4:BT42")
iNumCopies = Range("E1").Value
If iNumCopies < 1 Then iNumCopies = 1
MyRange.PrintOut Copies:=iNumCopies, Collate:=True
' Go to A4
Range("A4").Select
ThisWorkbook.Save
End Sub
For some reason it doesn’t copy and paste the correct range. If I run it multiple times, it sometimes pastes in different things each time. It works if I switch back to LO 5.4. Do I need to rewrite it to work with LO 6.0?
Thanks!