Toplamada yardım lütfen

Katılım
23 Temmuz 2008
Mesajlar
7
Excel Vers. ve Dili
2003 türkçe
Herkese merhabalar...
Aşagıda forumdan alıntı yaptığım kod var bu kod çalışıyor ama elle girmek gerekiyor, bunu otomatik olarak değişen bir hücreden nasıl hesaplatırız


Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, [A1]) Is Nothing Then Exit Sub
On Error GoTo hata
Range("B1").Value = Range("A1").Value + Range("B1").Value
Exit Sub
hata:
End Sub

teşekkürler
 

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
C1 hücresine aşağıdaki formülü giriniz.:cool:
Kod:
=topla(A1:B1)
 
Katılım
23 Temmuz 2008
Mesajlar
7
Excel Vers. ve Dili
2003 türkçe
Bu fonksiyondur.
C1 hücresine giriyorsunuz.:cool:
Sayın Evren arkadaşım ilginize teşekkürler fonksiyon çalışıyor ancak

Örnekteki gibi a1 hücresindeki değer 10 sn. debir güncelleniyor otomatik olarak

haliylede sürekli 10 sn de bir topluyor ama ben girilen güncellenen sayı farklı olduğunda toplamam gerekiyor.

Nasıl yapabilirim

Teşekkürler
 
Katılım
23 Temmuz 2008
Mesajlar
7
Excel Vers. ve Dili
2003 türkçe
Arkadaşlar bişeyler yaptım ve çalıştı ,incelerseniz sevinirim.

Sub toplama()

'Private Sub Worksheet_Change(ByVal Target As Range)
' Dim bekleme, baslama, durma, jarpa, karpa, larpa, malzeme, arpa, bugday, cavdar, kuspe, misirkpk, mozaik, pkepek, skuspe, ypaycicekkuspe, kepek, misir, bongalit, ygsoyakuspe, razmal, dkepek, kdtmisir, pkuspe
'
' If Intersect(Target, [g1]) Is Nothing Then Exit Sub
' On Error GoTo hata
malzeme = Range("c1").Value

jarpa = Range("j7").Value
karpa = Range("k7").Value
larpa = Range("l7").Value

jbugday = Range("j8").Value
kbugday = Range("k8").Value
lbugday = Range("l8").Value

jcavdar = Range("j9").Value
kcavdar = Range("k9").Value
lcavdar = Range("l9").Value

jkuspe = Range("j10").Value
kkuspe = Range("k10").Value
lkuspe = Range("l10").Value

jmsrkpk = Range("j11").Value
kmsrkpk = Range("k11").Value
lmsrkpk = Range("l11").Value

jmozaik = Range("j12").Value
kmozaik = Range("k12").Value
lmozaik = Range("l12").Value

jpkepek = Range("j13").Value
kpkepek = Range("k13").Value
lpkepek = Range("l13").Value

jskuspe = Range("j14").Value
kskuspe = Range("k14").Value
lskuspe = Range("l14").Value

jypacks = Range("j15").Value
kypacks = Range("k15").Value
lypacks = Range("l15").Value

jkepek = Range("j16").Value
kkepek = Range("k16").Value
lkepek = Range("l16").Value

jmisir = Range("j17").Value
kmisir = Range("k17").Value
lmisir = Range("l17").Value

jbongl = Range("j18").Value
kbongl = Range("k18").Value
lbongl = Range("l18").Value

jysksp = Range("j19").Value
kysksp = Range("k19").Value
lysksp = Range("l19").Value

jrazml = Range("j20").Value
krazml = Range("k20").Value
lrazml = Range("l20").Value

jdkepk = Range("j21").Value
kdkepk = Range("k21").Value
ldkepk = Range("l21").Value

jkdtms = Range("j22").Value
kkdtms = Range("k22").Value
lkdtms = Range("l22").Value

jpmksp = Range("j23").Value
kpmksp = Range("k23").Value
lpmksp = Range("l23").Value

arpa = Range("g7").Value
bugday = Range("g8").Value
cavdar = Range("g9").Value
kuspe = Range("g10").Value
misirkpk = Range("g11").Value
mozaik = Range("g12").Value
pkepek = Range("g13").Value
skuspe = Range("g14").Value
ypaycicekkuspe = Range("g15").Value
kepek = Range("g16").Value
misir = Range("g17").Value
bongalit = Range("g18").Value
ygsoyakuspe = Range("g19").Value
razmal = Range("g20").Value
dkepek = Range("g21").Value
kdtmisir = Range("g22").Value
pkuspe = Range("g23").Value
'
If malzeme <> arpa Then GoTo a
Call zaman

If jarpa = karpa Then GoTo a
Range("k7").Value = Range("j7").Value
Range("l7").Value = Range("j7").Value + Range("l7").Value

a:

If malzeme <> bugday Then GoTo b
Call zaman

If jbugday = kbugday Then GoTo b
Range("k8").Value = Range("j8").Value
Range("l8").Value = Range("j8").Value + Range("l8").Value
b:
If malzeme <> cavdar Then GoTo c
Call zaman

If jcavdar = kcavdar Then GoTo c
Range("k9").Value = Range("j9").Value
Range("l9").Value = Range("j9").Value + Range("l9").Value
c:
If malzeme <> kuspe Then GoTo d
Call zaman

If jkuspe = kkuspe Then GoTo d
Range("k10").Value = Range("j10").Value
Range("l10").Value = Range("j10").Value + Range("l10").Value
d:
If malzeme <> misirkpk Then GoTo e
Call zaman

If jmsrkpk = kmsrkpk Then GoTo e
Range("k11").Value = Range("j11").Value
Range("l11").Value = Range("j11").Value + Range("l11").Value
e:
If malzeme <> mozaik Then GoTo f
Call zaman

If jmozaik = kmozaik Then GoTo f
Range("k12").Value = Range("j12").Value
Range("l12").Value = Range("j12").Value + Range("l12").Value
f:
If malzeme <> pkepek Then GoTo g
Call zaman

If jpkepek = kpkepek Then GoTo g
Range("k13").Value = Range("j13").Value
Range("l13").Value = Range("j13").Value + Range("l13").Value
g:
If malzeme <> skuspe Then GoTo h
Call zaman

If jskuspe = kskuspe Then GoTo h
Range("k14").Value = Range("j14").Value
Range("l14").Value = Range("j14").Value + Range("l14").Value
h:
If malzeme <> ypaycicekkuspe Then GoTo i
Call zaman

If jypacks = kypacks Then GoTo i
Range("k15").Value = Range("j15").Value
Range("l15").Value = Range("j15").Value + Range("l15").Value
i:
If malzeme <> kepek Then GoTo j
Call zaman

If jkepek = kkepek Then GoTo j
Range("k16").Value = Range("j16").Value
Range("l16").Value = Range("j16").Value + Range("l16").Value
j:
If malzeme <> misir Then GoTo k
Call zaman

If jmisir = kmisir Then GoTo k
Range("k17").Value = Range("j17").Value
Range("l17").Value = Range("j17").Value + Range("l17").Value
k:
If malzeme <> bongalit Then GoTo l
Call zaman

If jbongl = kbongl Then GoTo l
Range("k18").Value = Range("j18").Value
Range("l18").Value = Range("j18").Value + Range("l18").Value
l:
If malzeme <> ygsoyakuspe Then GoTo m
Call zaman

If jysksp = kysksp Then GoTo m
Range("k19").Value = Range("j19").Value
Range("l19").Value = Range("j19").Value + Range("l19").Value
m:
If malzeme <> razmal Then GoTo n
Call zaman

If jrazml = krazml Then GoTo n
Range("k20").Value = Range("j20").Value
Range("l20").Value = Range("j20").Value + Range("l20").Value
n:
If malzeme <> dkepek Then GoTo o
Call zaman

If jdkepk = kdkepk Then GoTo o
Range("k21").Value = Range("j21").Value
Range("l21").Value = Range("j21").Value + Range("l21").Value
o:
If malzeme <> kdtmisir Then GoTo p
Call zaman

If jkdtms = kkdtms Then GoTo p
Range("k22").Value = Range("j22").Value
Range("l22").Value = Range("j22").Value + Range("l22").Value
p:
If malzeme <> pkuspe Then GoTo r
Call zaman

If jpmksp = kpmksp Then GoTo r
Range("k23").Value = Range("j23").Value
Range("l23").Value = Range("j23").Value + Range("l23").Value

r:
'
'
' hata:
End Sub

Sub zaman()
Dim durak, baslam, durm
bekleme = 2
baslam = Timer
Do While Timer < basla + durak
DoEvents
Loop
durm = Timer
End Sub
 
Üst