Good day everyone.
I have written a macro, and linked it to a control, to open an existing workbook and then to insert text in a specific cell(group of cells, the cells are merged). Regardless of what i change i keep on getting a runtime error 1004.
Here is the code i used:
Private Sub CommandButton1_Click()
' INSERTWHSQINWO Macro
' This macro inserts the white melamine squareline finish in the works order
Workbooks.Open Filename:="E:\Leisure Kitchens\NCS\PM.xls", UpdateLinks _
:=3
Range("F4:J6").Select
ActiveCell.FormulaR1C1 = "WHITE MELAMINE SQUARELINE"
With ActiveCell.Characters(Start:=1, Length:=25).Font
.Name = "Tahoma"
.FontStyle = "Regular"
.Size = 14
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
End Sub
Any suggestions would be greatly appreciated.
Thanks
Red
I have written a macro, and linked it to a control, to open an existing workbook and then to insert text in a specific cell(group of cells, the cells are merged). Regardless of what i change i keep on getting a runtime error 1004.
Here is the code i used:
Private Sub CommandButton1_Click()
' INSERTWHSQINWO Macro
' This macro inserts the white melamine squareline finish in the works order
Workbooks.Open Filename:="E:\Leisure Kitchens\NCS\PM.xls", UpdateLinks _
:=3
Range("F4:J6").Select
ActiveCell.FormulaR1C1 = "WHITE MELAMINE SQUARELINE"
With ActiveCell.Characters(Start:=1, Length:=25).Font
.Name = "Tahoma"
.FontStyle = "Regular"
.Size = 14
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
End Sub
Any suggestions would be greatly appreciated.
Thanks
Red