H
Henrootje
Who can tell me what is wrong with the following code?
NieuwArtikelNr is a worksheet name that functions ok in other code
FormuleC and FormuleE lock up
Formule G and Formule H give #NAME? but when I select the field and
give an enter (above in the formuladisplayingthingie) it works like a
charm.
I suspect it has to do with the way I enter the formula's into the
cell??
(ActiveCell.Formula = FormuleC)
Anybody has suggestions???????
Dim FormuleB As String
Dim FormuleC As String
Dim FormuleD As String
Dim FormuleE As String
Dim FormuleF As String
Dim FormuleG As String
Dim FormuleH As String
Dim FormuleI As String
Dim FormuleJ As String
FormuleB = "=" & NieuwArtikelNr & "!$A$3"
FormuleC = "=ALS(AANTALARG('" & NieuwArtikelNr &
"'!$A$9:$A$50)<=AANTALARG(" & NieuwArtikelNr & "!$D$9:$D$50);" & "Ja;"
& "Nee)"
FormuleD = "=" & NieuwArtikelNr & "!$D$10"
FormuleE = "=ALS(AANTALARG('" & NieuwArtikelNr &
"'!$A$9:$A$50)<=AANTALARG('" & NieuwArtikelNr &
"'!$D$9:$D$50);'Ja';'Nee')"
FormuleF = "NietGevuldInOrigineel"
FormuleG = "=AANTALARG(" & NieuwArtikelNr & "!$C$9:$C$50=CHM)"
FormuleH = "=AANTALARG(" & NieuwArtikelNr & "!$A$9:$A$50)"
FormuleI = "=" & NieuwArtikelNr & "!$D$3"
FormuleJ = FormuleI & "+ 365"
'ArtikelOmschrijving in B
Sheets("hoofdblad").Select
Range("B2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleB
'Beschikbaar in C
Sheets("hoofdblad").Select
Range("C2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleC
'Beschikbaar in D
Sheets("hoofdblad").Select
Range("D2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleD
'Beschikbaar in E
Sheets("hoofdblad").Select
Range("E2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleE
'Beschikbaar in F
Sheets("hoofdblad").Select
Range("F2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleF
'Beschikbaar in G
Sheets("hoofdblad").Select
Range("G2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleG
'Beschikbaar in H
Sheets("hoofdblad").Select
Range("H2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleH
'Beschikbaar in I
Sheets("hoofdblad").Select
Range("I2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleI
'Beschikbaar in J
Sheets("hoofdblad").Select
Range("J2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleJ
NieuwArtikelNr is a worksheet name that functions ok in other code
FormuleC and FormuleE lock up
Formule G and Formule H give #NAME? but when I select the field and
give an enter (above in the formuladisplayingthingie) it works like a
charm.
I suspect it has to do with the way I enter the formula's into the
cell??
(ActiveCell.Formula = FormuleC)
Anybody has suggestions???????
Dim FormuleB As String
Dim FormuleC As String
Dim FormuleD As String
Dim FormuleE As String
Dim FormuleF As String
Dim FormuleG As String
Dim FormuleH As String
Dim FormuleI As String
Dim FormuleJ As String
FormuleB = "=" & NieuwArtikelNr & "!$A$3"
FormuleC = "=ALS(AANTALARG('" & NieuwArtikelNr &
"'!$A$9:$A$50)<=AANTALARG(" & NieuwArtikelNr & "!$D$9:$D$50);" & "Ja;"
& "Nee)"
FormuleD = "=" & NieuwArtikelNr & "!$D$10"
FormuleE = "=ALS(AANTALARG('" & NieuwArtikelNr &
"'!$A$9:$A$50)<=AANTALARG('" & NieuwArtikelNr &
"'!$D$9:$D$50);'Ja';'Nee')"
FormuleF = "NietGevuldInOrigineel"
FormuleG = "=AANTALARG(" & NieuwArtikelNr & "!$C$9:$C$50=CHM)"
FormuleH = "=AANTALARG(" & NieuwArtikelNr & "!$A$9:$A$50)"
FormuleI = "=" & NieuwArtikelNr & "!$D$3"
FormuleJ = FormuleI & "+ 365"
'ArtikelOmschrijving in B
Sheets("hoofdblad").Select
Range("B2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleB
'Beschikbaar in C
Sheets("hoofdblad").Select
Range("C2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleC
'Beschikbaar in D
Sheets("hoofdblad").Select
Range("D2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleD
'Beschikbaar in E
Sheets("hoofdblad").Select
Range("E2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleE
'Beschikbaar in F
Sheets("hoofdblad").Select
Range("F2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleF
'Beschikbaar in G
Sheets("hoofdblad").Select
Range("G2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleG
'Beschikbaar in H
Sheets("hoofdblad").Select
Range("H2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleH
'Beschikbaar in I
Sheets("hoofdblad").Select
Range("I2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleI
'Beschikbaar in J
Sheets("hoofdblad").Select
Range("J2").End(xlDown).Offset(1, 0).Select
ActiveCell.Formula = FormuleJ