By LiamDuffy63 le lundi 05 décembre 2022
Publié dans Kutools for Excel
Réponses 2
Aime 0
Vues 5.6K
Votes 1
Salut, je suis nouveau sur les macros, VBA et Kutools.

J'exécute une macro pour extraire du texte puis des nombres dans des cellules séparées. Le Kutools fonctionne bien quand je l'exécute, mais quand je suis le même processus pour créer une macro, je reçois un message d'erreur :

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

Cela semble être là où l'erreur se produit dans le débogage.

J'ai ajouté Kutoolsforexcel dans Outils/Référence


Sous ConvetYardsToMiles()
'
' Macro ConvetYardsToMiles
'

'
Colonnes("I:I").Sélectionnez
Selection.Copy
Selection.Insert Shift :=xlToRight
Application.CutCopyMode = Faux
Selection.Copy
Selection.Insert Shift :=xlToRight
Colonnes("J:J").Sélectionnez
Windows("KutoolsHelper.xlam").Visible = True
ActiveWindow.Visible = Faux
Colonnes("K:K").Sélectionnez
Windows("KutoolsHelper.xlam").Visible = True
ActiveWindow.Visible = Faux
ActiveWindow.SmallScroll ToRight :=1
Plage("L2").Sélectionnez
ActiveCell.FormulaR1C1 = "=IF(RC[-2]=""mi"",RC[-1],RC[-1]/1760)"
Plage("L2").Sélectionnez
Selection.AutoFill Destination :=Range("L2:L832")
Plage("L2:L832").Sélectionnez
Colonnes("L:L").Sélectionnez
Selection.NumberFormat = "0.00 Miles"
Colonnes("L:L").Sélectionnez
Columns("L:L").EntireColumn.AutoFit
Sélection.ColumnWidth = 14.91
Plage("L1").Sélectionnez
ActiveCell.FormulaR1C1 = "Kilomètres parcourus"
Plage("L2").Sélectionnez
ActiveWindow.SmallScroll ToRight :=-1
Colonnes("H:K").Sélectionnez
Selection.EntireColumn.Hidden = Vrai
ActiveWindow.SmallScroll ToRight :=-4
Colonnes("L:L").Sélectionnez
Avec sélection
.HorizontalAlignment = xlGénéral
.VerticalAlignment = xlCentre
.Orientation = 0
.AddIndent = Faux
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
Terminer par
Avec sélection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCentre
.Orientation = 0
.AddIndent = Faux
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
Terminer par
Lignes("1:1").Sélectionnez
Plage("C1").Activer
Selection.Font.Bold = Faux
Selection.Font.Bold = Vrai
Avec sélection.Font
.Name = "Arial"
.Barré = Faux
.Exposant = Faux
.Indice = Faux
.OutlineFont = Faux
.Ombre = Faux
.Soulignement = xlUnderlineStyleNone
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
Terminer par
Avec sélection.Font
.Name = "Arial"
.Taille = 12
.Barré = Faux
.Exposant = Faux
.Indice = Faux
.OutlineFont = Faux
.Ombre = Faux
.Soulignement = xlUnderlineStyleNone
.TintAndShade = 0
.ThemeFont = xlThemeFontNone
Terminer par
Avec sélection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCentre
.WrapText = False
.Orientation = 0
.AddIndent = Faux
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
Terminer par
End Sub
J'AI LE MEME PROBLEME AVEC CETTE LIGNE DE CODE :

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

Est-il permis d'appeler une macro Kutools à partir d'une autre macro enregistrée ?
·
Il y a 1 année
·
0 aime
·
Votes 0
·
0 Commentaires
·
·
Il y a 1 année
·
0 aime
·
Votes 0
·
0 Commentaires
·
Voir l'article complet