IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Macros et VBA Excel Discussion :

Compatibilité MAC / PC ..?


Sujet :

Macros et VBA Excel

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Futur Membre du Club
    Profil pro
    Inscrit en
    Janvier 2012
    Messages
    3
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2012
    Messages : 3
    Par défaut Compatibilité MAC / PC ..?
    Bonjour a tous,

    J'ai un petit souci avec mon fichier, il s'agit en fait d'un systeme de facturier. En appuyant sur "nouvelle facture", il crée une nouvelle feuille et synthetise le tout ds un tableau.
    Le fichier marche pourtant très bien sur PC, mais me fait une "erreur 1004" lorsque je l'ouvre et le modifie sur mac ( et je travaille sur mac)
    Je ne maitrise pas assez VBA pour comprendre tout ce qui se passe.

    Je vous joins le fichier.

    N'hesitez pas si l'un de vous a une petite idée.

    Si ça peut aider : ( en gras l'erreur)
    peut il s'agir juste d un problème de compatibilité pc / mac..?




    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    Sub Lance()
    
    
    Application.Run "Nouvelles_Factures"
    
    
    End Sub
    Sub Nouvelles_Factures()
    
    
    Dim x As Long
    Dim Y As Long
    
    
    Sheets("Modèle").Select
    Range("I2").Select
    x = Range("I2").Value
    ActiveCell.FormulaR1C1 = x + 1
    Sheets("Modèle").Copy After:=Sheets(2)
    Sheets("Modèle (2)").Select
    Range("C13").Select
    Selection.Copy
    Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
    :=False, Transpose:=False
    Application.CutCopyMode = False
    With ActiveWorkbook.Sheets("Modèle (2)").Tab
    .ThemeColor = xlThemeColorAccent2
    .TintAndShade = 0.399975585192419
    End With
    Sheets("Synthèse").Select
    Range("B65536").Select
    Selection.End(xlUp).Select
    Y = ActiveCell.Row
    Range("B" & Y + 1).Select
    ActiveCell.FormulaR1C1 = "='Modèle (2)'!I5"
    Range("C" & Y + 1).Select
    ActiveCell.FormulaR1C1 = "='Modèle (2)'!I2"
    Range("D" & Y + 1).Select
    ActiveCell.FormulaR1C1 = "='Modèle (2)'!C13"
    Range("E" & Y + 1).Select
    ActiveCell.FormulaR1C1 = "='Modèle (2)'!F25"
    Range("F" & Y + 1).Select
    ActiveCell.FormulaR1C1 = "='Modèle (2)'!I33"
    Range("G" & Y + 1).Select
    ActiveCell.FormulaR1C1 = "='Modèle (2)'!H25"
    Range("H" & Y + 1).Select
    ActiveCell.FormulaR1C1 = "='Modèle (2)'!I35"
    Range("C5").Select
    ActiveCell.FormulaR1C1 = "=COUNT(R[3]C:R[" & Y - 4 & "]C)"
    Range("E5").Select
    ActiveCell.FormulaR1C1 = "=SUM(R[3]C:R[" & Y - 4 & "]C)"
    Range("F5").Select
    ActiveCell.FormulaR1C1 = "=SUM(R[3]C:R[" & Y - 4 & "]C)"
    Range("G5").Select
    ActiveCell.FormulaR1C1 = "=SUM(R[3]C:R[" & Y - 4 & "]C)"
    Range("H5").Select
    ActiveCell.FormulaR1C1 = "=SUM(R[3]C:R[" & Y - 4 & "]C)"
    Range("H6").Select
    Range("B" & Y + 1 & ":H" & Y + 1).Select
    Selection.Replace What:="'I5'", Replacement:="I5", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False
    Selection.Replace What:="'I2'", Replacement:="I2", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False
    Selection.Replace What:="$M:$M", Replacement:="C13", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False
    Selection.Replace What:="'C13'", Replacement:="C13", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False
    Selection.Replace What:="'F25'", Replacement:="F25", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False
    Selection.Replace What:="'I33'", Replacement:="I33", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False
    Selection.Replace What:="'H25'", Replacement:="H25", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False
    Selection.Replace What:="'I35'", Replacement:="I35", LookAt:=xlPart, _
    SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
    ReplaceFormat:=False
    Range("B" & Y + 1 & ":J" & Y + 1).Select
    With Selection.Borders(xlEdgeLeft)
    .LineStyle = xlContinuous
    .ColorIndex = xlAutomatic
    .TintAndShade = 0
    .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeTop)
    .LineStyle = xlContinuous
    .ColorIndex = xlAutomatic
    .TintAndShade = 0
    .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeBottom)
    .LineStyle = xlContinuous
    .ColorIndex = xlAutomatic
    .TintAndShade = 0
    .Weight = xlThin
    End With
    With Selection.Borders(xlEdgeRight)
    .LineStyle = xlContinuous
    .ColorIndex = xlAutomatic
    .TintAndShade = 0
    .Weight = xlThin
    End With
    With Selection.Borders(xlInsideVertical)
    .LineStyle = xlContinuous
    .ColorIndex = xlAutomatic
    .TintAndShade = 0
    .Weight = xlThin
    End With
    Range("I" & Y + 1).Select
    With Selection.Validation
    .Delete
    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
    xlBetween, Formula1:="=$L$1:$L$2"
    .IgnoreBlank = True
    .InCellDropdown = True
    .InputTitle = ""
    .ErrorTitle = ""
    .InputMessage = ""
    .ErrorMessage = ""
    .ShowInput = True
    .ShowError = True
    End With
    Range("J" & Y + 1).Select
    With Selection.Validation
    .Delete
    .Add Type:=xlValidateList, AlertStyle:=xlValidAlertStop, Operator:= _
    xlBetween, Formula1:="=$M$1:$M$3"
    .IgnoreBlank = True
    .InCellDropdown = True
    .InputTitle = ""
    .ErrorTitle = ""
    .InputMessage = ""
    .ErrorMessage = ""
    .ShowInput = True
    .ShowError = True
    End With
    Range("D" & Y + 1).Select
    Selection.NumberFormat = "m/d/yyyy"
    Range("E" & Y + 1 & ":H" & Y + 1).Select
    Selection.NumberFormat = "#,##0.00 $"
    Range("A1").Select
    Sheets("Modèle (2)").Select
    Sheets("Modèle (2)").Name = "Facture N°" & x + 1
    Range("A1").Select
    
    End Sub
    Fichiers attachés Fichiers attachés

  2. #2
    Expert éminent

    Profil pro
    Conseil, Formation, Développement - Indépendant
    Inscrit en
    Février 2010
    Messages
    8 562
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Conseil, Formation, Développement - Indépendant

    Informations forums :
    Inscription : Février 2010
    Messages : 8 562
    Par défaut
    Bonjour

    La première chose à faire est de dire quelle ligne provoque l'erreur : appuyer sur debug et repérer la ligne jaune

    Par ailleurs précise ta version Excel : il en existe plusieurs sur MAC.

    Je n'ai pas de MAC et ne pourrait donc t'aider mais au moins cela permettra de mieux cerner ton problème ...

Discussions similaires

  1. Compatibilité MAC de la fonction DIR
    Par papyjac dans le forum Macros et VBA Excel
    Réponses: 2
    Dernier message: 15/08/2013, 19h34
  2. Compatibilité MAC PC
    Par soledad_001 dans le forum Débuter
    Réponses: 2
    Dernier message: 31/01/2010, 14h50
  3. Assurer une compatibilité Mac
    Par Deaf dans le forum Général Java
    Réponses: 3
    Dernier message: 04/03/2009, 11h28
  4. [Débutant] probleme compatibilité mac pc little et big endian
    Par tang97 dans le forum MATLAB
    Réponses: 2
    Dernier message: 14/02/2009, 10h07
  5. Compatibilité MAC et Microsoft
    Par justin92330 dans le forum Macros et VBA Excel
    Réponses: 1
    Dernier message: 01/08/2008, 21h27

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo