Monday, 05 December 2022
  2 Replies
  5.8K Visits
-1
Votes
Undo
Hi, I am new to Macros, VBA and Kutools.

I am running a macro to extract text then numbers in separate cells. The Kutools works fine when i run it, however when i follow the same process to create a macro, I get an error message:

Windows("KutoolsHelper.xlam").Visible = True

This appears to be where the error occurs in the debugging.

I have added Kutoolsforexcel in Tools/Reference


Sub ConvetYardsToMiles()
'
' ConvetYardsToMiles Macro
'

'
Columns("I:I").Select
Selection.Copy
Selection.Insert Shift:=xlToRight
Application.CutCopyMode = False
Selection.Copy
Selection.Insert Shift:=xlToRight
Columns("J:J").Select
Windows("KutoolsHelper.xlam").Visible = True
ActiveWindow.Visible = False
Columns("K:K").Select
Windows("KutoolsHelper.xlam").Visible = True
ActiveWindow.Visible = False
ActiveWindow.SmallScroll ToRight:=1
Range("L2").Select
ActiveCell.FormulaR1C1 = "=IF(RC[-2]=""mi"",RC[-1],RC[-1]/1760)"
Range("L2").Select
Selection.AutoFill Destination:=Range("L2:L832")
Range("L2:L832").Select
Columns("L:L").Select
Selection.NumberFormat = "0.00 Miles"
Columns("L:L").Select
Columns("L:L").EntireColumn.AutoFit
Selection.ColumnWidth = 14.91
Range("L1").Select
ActiveCell.FormulaR1C1 = "Miles Driven"
Range("L2").Select
ActiveWindow.SmallScroll ToRight:=-1
Columns("H:K").Select
Selection.EntireColumn.Hidden = True
ActiveWindow.SmallScroll ToRight:=-4
Columns("L:L").Select
With Selection
.HorizontalAlignment = xlGeneral
.VerticalAlignment = xlCenter
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Rows("1:1").Select
Range("C1").Activate
Selection.Font.Bold = False
Selection.Font.Bold = True
With Selection.Font
.Name = "Arial"
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
With Selection.Font
.Name = "Arial"
.Size = 12
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
End With
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
End Sub
1 year ago
·
#3346
0
Votes
Undo
I HAVE THE SAME ISSUE WITH THIS LINE OF CODE:

Windows("KutoolsHelper.xlam").Visible = True

Is it allowed to Call a Kutools macro from another recorded macro?
  • Page :
  • 1
There are no replies made for this post yet.