I am using 2 PCs, using Windows 7 64 and 32.
Unfortunately, I know nothing about programming, and I need your help regarding a macro that worked in Excel 2010 on my Win 64 and 32, but now it is working only on the 32 version.
MS Office stopped working on the 64 PC, and I cannot reinstall it.
Basically, it uses 2 sheets. It is supposed to produce a shipping slip.
On the first sheet, I write the shipping address details.
I am clicking on the button "Save & Print", and this sheet is being send to the printer, and at the same time, the details are written on sheet 2, including the date and the product details (SET36 1958 08 March 2015) in sheet2.jpg.
I've copied the macro text (from Excel), and I am attaching it here.
Please help me to make it active on Open Office.
Many thanks in advance!
The Excel code:
Code: Select all
Sub Button1_Click()
Dim nCount As Integer
Dim strCell As String
Dim strName As String
nCount = Sheet2.Range("E2").FormulaR1C1
strCell = "A" & Trim(Str(4 + nCount))
Sheet2.Range(strCell).FormulaR1C1 = Now
strCell = "B" & Trim(Str(4 + nCount))
strName = Trim(Replace(Trim(Sheet1.Range("E6").FormulaR1C1), Chr(10), " / "))
Sheet2.Range(strCell).FormulaR1C1 = strName
strCell = "C" & Trim(Str(4 + nCount))
strName = Trim(Replace(Trim(Sheet1.Range("A26").FormulaR1C1), Chr(10), " / "))
Sheet2.Range(strCell).FormulaR1C1 = strName
nCount = nCount + 1
Sheet2.Range("E2").FormulaR1C1 = nCount
MsgBox "The receipt has been saved, and sent to printer", vbInformation
ActiveWindow.SelectedSheets.PrintOut
End Sub
Sub Macro1()
'
' Macro1 Macro
' Macro recorded 13/12/2006 by Miky
'
'
Range("A7:E17").Select
ActiveCell.FormulaR1C1 = _
"Micronic1" & Chr(10) & " Michael Nxxxx" & Chr(10) & " 14611 Axxxx Str." & Chr(10) & " Sxxxx Oxxx, CA 91000" & Chr(10) & " United
States" & Chr(10) & ""
With ActiveCell.Characters(Start:=1, Length:=89).Font
.Name = "Times New Roman"
.FontStyle = "Bold"
.Size = 20
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
With ActiveCell.Characters(Start:=90, Length:=1).Font
.Name = "Times New Roman"
.FontStyle = "Bold"
.Size = 18
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
ActiveSheet.Paste
Range("D1").Select
ActiveCell.FormulaR1C1 = "3"
Range("D2").Select
End Sub