Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Get Balance of an entry


Hi there

I am trying to get the balance of one entry ,...................but
???
i.e. Db side must equal Cr side of one entry, otherwise
the difference should appear in the next column


Code:
--------------------
Sub testbal()
Dim Db As Currency
Dim Cr As Currency
Dim v3 As Currency
Dim entryN As Long
Dim i As Long

With Range("bon")
entryN = .Cells(1, 1)
While .Cells(1, 1) = entryN
For i = 2 To 20
Db = .Cells(i, 4)
Cr = .Cells(i, 5)
If Db < Cr Then
v3 = Db - Cr
.Cells(i, 6) = v3
End If
Db = 0
Cr = 0
entryN = .Cells(i, 1)
Next i
Wend
End With
End Sub
--------------------


--
helmekki


------------------------------------------------------------------------
helmekki's Profile: http://www.excelforum.com/member.php...fo&userid=6939
View this thread: http://www.excelforum.com/showthread...hreadid=478520

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Get Balance of an entry

not sure exactly what you sheet looks like, but i get it to run if i get rid
of the period before the cells() entries

--


Gary


"helmekki" wrote in
message ...

Hi there

I am trying to get the balance of one entry ,...................but
???
i.e. Db side must equal Cr side of one entry, otherwise
the difference should appear in the next column


Code:
--------------------
Sub testbal()
Dim Db As Currency
Dim Cr As Currency
Dim v3 As Currency
Dim entryN As Long
Dim i As Long

With Range("bon")
entryN = .Cells(1, 1)
While .Cells(1, 1) = entryN
For i = 2 To 20
Db = .Cells(i, 4)
Cr = .Cells(i, 5)
If Db < Cr Then
v3 = Db - Cr
.Cells(i, 6) = v3
End If
Db = 0
Cr = 0
entryN = .Cells(i, 1)
Next i
Wend
End With
End Sub
--------------------


--
helmekki


------------------------------------------------------------------------
helmekki's Profile:
http://www.excelforum.com/member.php...fo&userid=6939
View this thread: http://www.excelforum.com/showthread...hreadid=478520



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Get Balance of an entry


Thank u very much


--
helmekki


------------------------------------------------------------------------
helmekki's Profile: http://www.excelforum.com/member.php...fo&userid=6939
View this thread: http://www.excelforum.com/showthread...hreadid=478520

Reply
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
balance in excel that only shows the last entry mchick New Users to Excel 3 July 27th 09 03:06 AM
Auto entry of data based on entry of text in another column or fie Judy Rose Excel Discussion (Misc queries) 2 May 21st 08 01:14 PM
Cell Entry That Locks Selected Cells From Any Data Entry. ron Excel Worksheet Functions 5 February 16th 07 09:52 PM
rent received/balance owed/running balance spreadsheet Quickbooks dummy Excel Discussion (Misc queries) 1 January 2nd 06 07:34 PM
automatic entering Balance at every entry in my bank account Sena Excel Discussion (Misc queries) 2 August 10th 05 05:44 PM


All times are GMT +1. The time now is 06:32 PM.

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

About Us

"It's about Microsoft Excel"