LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Who can tell me where I go wrong?

I can't figure out all of your formulas but you missed my point. You can
change your code to avoid selections and make it easier.

Sub makeformulaonsheet()
with Sheets("hoofdblad")
'.Range("i1").End(xlDown).offset(1).Formula = "=i1+i2"
..Range("B2").End(xlDown).Offset(1).Formula = "=" & NieuwArtikelNr & "!$A$3"
..Range("C2").End(xlDown).Offset(1).Formula = you fill in the rest
..Range("D2").End(xlDown).Offset(1).Formula = FormuleD
..Range("E2").End(xlDown).Offset(1).Formula = FormuleE
..Range("F2").End(xlDown).Offset(1).Formula = FormuleF
..Range("G2").End(xlDown).Offset(1).Formula = FormuleG
..Range("H2").End(xlDown).Offset(1).Formula = FormuleH
..Range("I2").End(xlDown).Offset(1).Formula = FormuleI
..Range("J2").End(xlDown).Offset(1).Formula = "=" & NieuwArtikelNr &
"!$D$3+365"


end with
End Sub

You don't say what this is? NieuwArtikelNr. If a sheet name, try
"=NieuwArtikelNr!$A$3"
instead of
"=" & NieuwArtikelNr & "!$A$3"

--
Don Guillett
SalesAid Software

"Henrootje" wrote in message
oups.com...
Changed code:

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 = "_"
FormuleG = "=COUNTA(" & NieuwArtikelNr & "!$C$9:$C$50=CHM)"
FormuleH = "=COUNTA(" & NieuwArtikelNr & "!$A$9:$A$50)"
FormuleI = "=" & NieuwArtikelNr & "!$D$3"
FormuleJ = FormuleI & "+ 365"

Sheets("hoofdblad").Select

Range("B2").End(xlDown).Offset(1, 0).Formula = FormuleB
Range("C2").End(xlDown).Offset(1, 0).Formula = FormuleC
Range("D2").End(xlDown).Offset(1, 0).Formula = FormuleD
Range("E2").End(xlDown).Offset(1, 0).Formula = FormuleE
Range("F2").End(xlDown).Offset(1, 0).Formula = FormuleF
Range("G2").End(xlDown).Offset(1, 0).Formula = FormuleG
Range("H2").End(xlDown).Offset(1, 0).Formula = FormuleH
Range("I2").End(xlDown).Offset(1, 0).Formula = FormuleI
Range("J2").End(xlDown).Offset(1, 0).Formula = FormuleJ

Now Formule G = H work great but C and E do not. The trick I used in
G=H, using the english expressions, did not work in C+E :(
If I take out the '=' out of formula C and E I have nice text in my
cells. If I manually then put the '=' in the field it works like a
charm...........

Suggestions?

TIA!!! (Forgot that in first post, sorry)



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Calculated Field (wrong Qty*Price = wrong Amount) Edmund Excel Discussion (Misc queries) 8 October 4th 07 12:13 PM
i did something wrong Roy Excel Discussion (Misc queries) 3 October 9th 06 10:45 PM
What is wrong with this bach Excel Discussion (Misc queries) 0 September 6th 05 09:09 AM
What is wrong? Andy Dorph Excel Programming 1 April 12th 05 04:52 PM
Where am I going wrong with this? [email protected] Excel Programming 1 May 25th 04 05:04 PM


All times are GMT +1. The time now is 07:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"