Total In Datagrid
can somebody tell me how to add total column in a datagrid say i want to get total in column 2 of the datagrid
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
DataGrid Total
Heloo.
I am using the code belwo to calculate the total of a column in a datagrid, it works OK, but when the datagrid reaches hundreds of records, it display the below error message. I have to maximaize the datagrid to the highest in order for this code to work, otherwise this error message will appear with a few records.
Error Message
Invalid Row Number
======================
Code Used:
Dim total1
For i = 0 To DataGrid2.ApproxCount - 1
DataGrid2.Row = i
DataGrid2.Col = 1
total1 = Val(total1) + Val(DataGrid2.Text)
Next
Text8.Text = total1
Thanks
Datagrid Column Total
Hello
Any One Help Me?
I have 4 columns in grid
1 itemname
2. Price
3 Qty
4 Amout
I want to amout = price*Qty at time of type value
DataGrid Column Total
Hello
Any One Help Me?
I have 4 columns in grid
1 itemname
2. Price
3 Qty
4 Amout
I want to amout = price*Qty at time of type value
Total Sum Of A Datagrid Column
Hi All
I have a datagrid attached to an dbase app I am working on, the last column has a price value and I would like to create a total value for this column in a label or text box. I was searching back the old posts looking for some pointers or a code snippet that would do this but was unable to find anything.
Any help appreciated
Thanks
Rob
Datagrid - Return Total Rows
Hi,
I am using a datagrid first-time and simply want to return the number of total records. Its only one column and I want to get a row count.
something like statusbar.simpletext = Their are 200 records in this datagrid.
Any help appreciated.
Thanks.
Total Currency In DataGrid Column
Here is the code I'm trying to use to add the currency in Column1 of a DataGrid and have it show in the txtTotal.Text textbox. I have used this a couple of years back so I just copied the code but am now getting an error here
dSum = dSum + rs("Total2")
It has something to do with rs("Total2")
Would appreciate any and all help
========================================
Dim fmtCurr As New StdDataFormat
fmtCurr.Format = "Currency"
Set DataGrid1.Columns(1).DataFormat = fmtCurr
Dim rs As ADODB.Recordset
Dim dSum As Double
Set rs = Adodc2.Recordset.Clone
rs.MoveFirst
Do Until rs.EOF
dSum = dSum + rs("Total2")
rs.MoveNext
Loop
Set rs = Nothing
txtTotal.Text = dSum
===========================
Thanks
DataGrid Total Column Count
Here is a question in VB6 you could do something like this to go through all the cells in a MSHFlexGrid1
PHP Code:
With MSHFlexGrid1
For iCol = 0 To MSHFlexGrid1.Cols - 1
If iCol = 1 Then
mstTitle = .TextMatrix(iRow, iCol)
End If
If iCol = 2 Then
mstDescription = .TextMatrix(iRow, iCol)
End If
If iCol = 13 Then
mstRecordID = .TextMatrix(iRow, iCol)
GetRecordID
End If
stColumnHeader = MSHFlexGrid1.ColHeaderCaption(0, iCol) & ": "
stDisplayText = stDisplayText & stColumnHeader & .TextMatrix(iRow, iCol) & vbCrLf & vbCrLf
Next
End With
Now in VB.NET I am trying to do something like that when a user clicks a cell in a DataGrid.
PHP Code:
With DataGrid2.Item(iCol, iRow)
For iCol = 0 To DataGrid2.VisibleColumnCount
stColumnHeader = DataGrid2.CaptionVisible.ToString & ": "
stDisplayText = stDisplayText & stColumnHeader & DataGrid2.Item(iRow, iCol) & vbCrLf & vbCrLf
Next
End With
But in this line "For iCol = 0 To DataGrid2.VisibleColumnCount" instead of DataGrid2.VisibleColumnCount I want the total column count any ideas?
Display Total In Datagrid Footer/last Row
hi i got a problem on how to display the total value of the records in each record from a database. i have populated the datagrid with the records from the database, but i dont know how to display the total amount in the last row of the datagrid.
please help..
Currency Total From Datagrid Inserted Into Txtbox
I have a datagrid that the user can edit, delete. add etc and it works fine.
The total from one currency column needs to be automaticly updated after the user makes changes and he clicks a Save cmdbutton. At the moment with this code I can only make it work by using a seperate command button to update the total. I would like to do it without using a cmdbutton to update the total. The error I get if I include the code anywhere else is you cannot add a empty row. Hopefully someone can show me how to modifiy this code.
VB Code:
If Adodc2.Recordset.RecordCount <> 0 And Adodc2.Recordset.BOF = False And Adodc2.Recordset.EOF = False ThenDim fmtCurr As New StdDataFormat fmtCurr.Format = "Currency" Set DataGrid1.Columns(1).DataFormat = fmtCurr Dim rs As ADODB.RecordsetDim dSum As DoubleSet rs = Adodc2.Recordset.Clone rs.MoveFirstDo Until rs.EOF If IsNumeric(rs("ValueChgOrder")) Then _ dSum = dSum + rs("ValueChgOrder") rs.MoveNextLoop Set rs = Nothing txtTotal.Text = FormatCurrency(dSum)ElsetxtTotal.Text = "" End If
Thanks for any help
[Resolved}DataReport With Sub Total And Grand Total With Out DataEnvironment
rsTotals.Open " SELECT Account_Type, Tax_Type, SUM(Payment)AS Total " _
& " FROM tbl_TransDetails " _
& " WHERE Entry_Date = # " & Date & " # GROUP BY Account_Type, Tax_Type ", _
dbCCP, adOpenDynamic, adLockOptimistic, adCmdText
With rptSumTotals
Set .DataSource = rsTotals
.Sections("Section1").Controls.Item("txtAccounttype").DataMember = ""
.Sections("Section1").Controls.Item("txtAccounttype").DataField = rsTotals.Fields("Account_Type").Name
.Sections("Section1").Controls.Item("txtTaxtype").DataMember = ""
.Sections("Section1").Controls.Item("txtTaxtype").DataField = rsTotals.Fields("Tax_Type").Name
.Sections("Section1").Controls.Item("txtTotal").DataMember = ""
.Sections("Section1").Controls.Item("txtTotal").DataField = rsTotals.Fields("Total").Name
'for sub total
.Sections("Section7").Controls.Item("fnSumTT").DataMember = "" 'rsTotals
.Sections("Section7").Controls.Item("fnSumTT").DataField = rsTotals!Total
'for grand total
.Sections("Section5").Controls.Item("fnGTotal").DataMember = "" 'rsTotals
.Sections("Section5").Controls.Item("fnGTotal").DataField = rsTotals!Total
.Refresh
.Show
giving error: its looking for payment values instead of Total values. so not able to find.
i placed Function control in Group footer section for sub totals and for grand total in Report footer section.
i am not using Data Environment as Data Source.
SQL is good, with out sub and Grand total i am able to print report with Total. after adding Those two function controls i am getting error.
If i assign rsTotals as DataMember "Type Missmatch error"
Help Me, Thanks in advance
>>>>>>>>>>>>>>>>>>>>>>
Edited by - sreddy on 3/24/2005 9:25:02 AM
Total Newb Need Total Help
ok im making an rpg.. ive made 2 forms, a main menu screen with my tilte, and Login , Options, Web, and quit buttons... my second form is the login screen.. how do i make it so that when i clcik login, it makes the menu dissapear and the login form apear,
also the same would be for options i guess. as soon as i make a form for that.
after that i want my "web" button to keep the exe open but popup an internet page connecting to my website,
and then quit, i want it to close main menu.
then in my login form, i have a similar thing, but i have a cancel button,
it is set to cancel= true but it dosent do anything, how do i make it so that the login.frm closes and comes back to the main menu??
plz help me out im a total newb.. and i dont know about programmign that much.. also, where can i find a good website that sows all commands with descriptions and examples on how to use them for vb?? plz plz plz help!!
Getting Total Tcp In/out
i've searched for this thread but i don't seem to find it, how do i get the total size for downloaded or uploaded files for a specific ip address (i'm in a network, so i need this to work as well)
any help is appreciated
Sum Total
At The end of the month a row is inserted. I am looking to sum the column totals between a number of rows. The first four columns are whole #. The last column is the date. I would need to execute this for any subsequent month. Any help is appreciated.
i.e.
2 3 1 2 4/1/04
1 1 1 1 4/2/04
..............4/3/04
......................
.....................
_______________ monthly total
1 1 1 1 5/1/04
Why Is There No Total?
Hi there.
For some reason, why is it not doing a calculation for yen? it is doing it for the rest of the currencies, but not yen:
Code:
If txtcurrencytype.Text = "Yen" Or txtcurrencytype.Text = "yen" Then
Dim yenbuyvalue As Double
yenbuyvalue = "175.28"
txtexchangerate.Text = yenbuyvalue
ask = InputBox("Please enter teh amount of " & txtcurrencytype.Text & " to " & txttransactiontype.Text)
txtamount.Text = ask
working = Math.Round(working / yenbuyvalue)
txtsubtotal.Text = working
commission = 2 / 100 * (CDbl(working + working))
txttotal.Text = "£" & Math.Round((commission), 2)
End If
it just gives me 0
Total Box Help
HI
I have a List box full prices, now i want the system to make a total in a textbox which i have created, can anyone tell me how to do this.
Thanks in advance
Sub Total In CRW
Hi. Is there a form to print subtotal per page in Crw?. I mean print subtotal in the footer area.
Pag:1 unds.
item 1 10
item 2 1
item n 8
Sub total: 19
Pag:2 unds.
item 1 1
item 2 1
item n 2
Sub total: 23
Pag:3 unds.
item 11 1
item 21 1
item n1 1
Sub total: 26
Total
I have vsflex grid linked to my acess database. I have a paid feild in my vsflexgrid. is their a way on my for to show a label of the total amount in the paid feild in the vsflexgrid??? SO if their were three records $10,20,30 it would show $60 in the label?
Need Help With Getting The Total
i have a table named charges and it is related in a master table, the charges table is too big, it has the size of about 98 mb, when i execute a query (rom DAO or ADO) like
query = "SELECT sum(amt) as [sum_amt], item_code FROM charges WHERE pk = '" & myPkey & "' GROUP BY item_code"
the computer hangs up, but if the table charges is not that big like 30 mb it run smoothly, so i decided to create a function for this. but ive got no idea of it, any idea on this, im thinking of comparing the previous, next, and present record inside a loop statement.
Sql Total/sum Help
I am trying to figure out if I can do all of this in one sql statement. I have a table with 3 fields, customer, quantity & rate. Here is an example of what the data in the table looks like:
customer qty rate
122 3 2
122 4 -1
122 7 1
457 2 -1
457 1 4
What I need the sql statement to do is to multiply the qty by the rate for each line, then total it for each customer id, and only select customer ids where the total is not zero. Easy right? lol Is it possible? I'm doing this with seperate sql statements & loops right now, and it takes forever. Thanks for any/all help!
Getting A Total
Hi, I am new to VB and I have to do an exercise which record employee overtime. I have a textbox which must to display total hours per day. The program needs to add records from a database(if any) and the one which has been recently entered and display it to the textbox. MY problem is in writing this program.
Total SQL?
Hey Guys,
VB Code:
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & App.Path & "Pilot Logbook.mdb;Persist Security Info=False;" rst.CursorLocation = adUseClient 'Set to enable Cursor movement rst.Open "SELECT * FROM Table_Pilot_Logbook", cnn
This is killing me, how can I get an agregate Total from an
open RecordSet. (I can add each value to a Variable as I loop
past, that code not shown). However, Can't I do it with SQL?
I have searched but the examples I find don't help.
SQL = Select (fieldname) As Total From Table
Do I need to have another rst.Open?
Can I do rst.?????Select (x) As Total From Table
Then where is the data??
Confussed
Cheers,
Bruce.
Getting Age Total
I am doing a application program. I have finished all my program. I need to take a page total from using data report in vb. I am using Back-end as Ms-Access.Please help me to solve the solutions
Get Total
I have this code it works great.
It opens a file and searchs for a value. once its done with that file it goes to the next file. I have 3 files total.
I need to give the total of the value ID. in each file
Does anyone know how to do this?
Thanks in advance
Dim File As String
Dim TextLine As String
Dim ssn As String
Dim name As String
Dim i As Integer
Dim stucntr As Integer
Dim filecntr As Integer
stucntr = 0
For filecntr = 1 To 3
File = "C:VB_PROJECTSFileJQ0" & CStr(filecntr) & "H301"
If (FileExists(File) = True) Then
Open File For Input As #1
If Not EOF(1) Then
Do While Not EOF(1)
Line Input #1, TextLine
If InStr(TextLine, "ID:") > 0 Then
MsgBox "hello"
End If
Loop
Close #1
End If
End If
Next
Total Of Col 3
I need to add all the values in column 3 on my datagrid control after each post by the user and display the result in a label. What is the best way to go about doing this? Thanks.
Total Newbie Right Here
Ay, I wanna learn DirectX 8 programming for a total newbie! The kind of tutorials that are easy and that don't have complicated sections... I'd be grateful if ya can help me out! Thanks in advance!!!!
Running Total
Im just getting started in VB so talk down to me. I have a program that has 6 pages. I'd like to get a total for each page, and then one for the project. How do i keep a running total ? This is what I have, but it's not working. it only show's when there's a change in that box. How do I get it to update on its own?
Public Sub PageTot_Change()
Dim vPageTot As Variant
vPageTot = Val(PlugTot.Text) + Val(FlrTot.Text) + Val(WPTot.Text)
PageTot.Text = vPageTot
End Sub
Please Help Me, Im A Total Newbie.
Hey there, i've been trying to get my protam working and i have come up with one problem so far and it isd as follows;
My program is supposed to allow users to logon by typing there user name. i don't want to use an "array" (i think thats what it is) i just want it to recongise a text value. This text value i have used in other areas as a welcome message (e.g Welcome user "inputed text"). now i've put in an extra that stops u from just pressing ener and leaving the text box blank using an if statement. But how can i allow only valid names to be entered and allowed through? my code is as follows;
Private Sub cmd_Verify_Click()
Dim MembershipNumber As String 'Declaring The Variable
Let MembershipNumber = txt_MembershipNumber.Text
If MembershipNumber = "" Then
frm_Error.Show
frm_Logon.Hide
End If
If MembershipNumber = Content Then
frm_Choices.Show 'Shows the Main Choices form
frm_Choices.pic_Welcome.Print "Hello Member " & MembershipNumber 'Puts the Member Name in the Welcome Box
frm_Logon.Hide 'Hides The Logon form
End If
End Sub
Please help me...
Total VBA Newbie
Hi folks
I've just been set a spreadsheet macro task but I have never even used a macro before let alone write one.
I have a reasonable knowledge of VB so coding isn't so much a problem - what I need is a few pointers for the following:
:- how do I grab data from a particular cell over multiple worksheets.
:- how do I then write data to a particualr cell?
If I can work this out, I am hoping I will be able to complete the task.
Thanks in advance
I Am At A Total Loss For How To Fix This
I've been trying to get an answer as to why this is happening from different forums on the net and as of yet no one has been able to tell me why it happens or how to fix it. Here is the situation:
Basically, in one of my get methods:
Code:
Property Get H() As Double
H = CalcH 'This was implemented as the "Back Way" and it fixed problem, before the code in CalcH was in here
End Property
Private Function CalcH() As Double
If pH <= 0# And pT > 0# And pP > 0# Then 'calculate if not set
pH = STMPTH(pP, pT)
ElseIf pH <= 0# And pT > 0# Then
If pType = StreamType.Water Then
pH = STMTQH(pT, 0#)
Else
pH = STMTQH(pT, 1#)
End If
ElseIf pH <= 0# And pP > 0# Then
If pType = StreamType.Water Then
pH = STMPQH(pP, 0#)
Else
pH = STMPQH(pP, 1#)
End If
End If
CalcH = pH
End Function
When I run the program, I give pH a value of 1488. But when it comes to retrieving that value the compiler goes nuts. If I run the program, I get "Error 6: Overflow". So I use the debugger, I step through the WHOLE program... and it completes its run with no issue.... so I run again... and get the error. I find out it is when I retrieve the H value. So I put a break right there. I run program to the break and then step through the retrieval and find something quite odd. When it gets to the
Code:
If pH <= 0# And pT > 0# And pP > 0# Then 'calculate if not set
it actually returns true... but pH has a value of 1488! so I do this again and mouse over the pH to see what it says and it says "pH = 0" thats odd... I hit F8 to step. then mouse over pH, still "pH = 0" I open up the locals window and locate the pH variable. it says "pH = 1488", I mouse over pH again and now it says "pH = 1488" BUT IT JUST PASSED AN IF STATEMENT SAYING IF<=0!!!! please help!
Screenshots (in order):
1
2
3
4
5
6
7
Here is the rest of the class (omited CalcH due to its already posted)
Code:
Private pP As Double 'Pressure of the stream
Private pT As Double 'Temperature of the stream
Private pH As Double 'Enthalpy of the stream
Private pW As Double 'Flow of the stream
Private pType As StreamType 'Type of stream: Steam, Water, Leak(Enum)
Private pName As String 'Name of the stream
Property Let P(P As Double)
pP = P
End Property
Property Let T(T As Double)
If pType = Steam And pP <> 0 Then
If (T - STMPT(pP)) < 27 Then 'Check for 27 degree superheat per PTC 6
pT = 0
Else
pT = T
End If
Else
pT = T
End If
End Property
Property Let H(H As Double)
pH = H
End Property
Property Let W(W As Double)
pW = W
End Property
Property Get P() As Double
P = pP
End Property
Property Get T() As Double
If pT = 0 And pH > 0 And pP > 0 Then 'calculate if temp unknown & H known
If Not SuperHeat Then
pT = STMPHT(pP, pH)
End If
End If
T = pT
End Property
Property Get H() As Double
H = CalcH
End Property
Property Get W() As Double
W = pW
End Property
Property Get SType() As StreamType
SType = pType
End Property
Property Get Name() As String
Name = pName
End Property
Property Get S() As Double 'Get Entropy
If pT <> 0 And pP <> 0 Then
S = STMPTS(pP, pT)
ElseIf pT = 0 And pP <> 0 Then
S = STMPHS(pP, H)
End If
End Property
Property Get x() As Double 'Get X
x = STMPHQ(pP, H)
End Property
Property Get Q() As Double 'Get Energy Flow Rate (H*W)
Q = H * pW
End Property
Property Get V() As Double 'Get Specific Volume
V = STMPTV(P, T)
End Property
Property Get Density() As Double 'Get Specific Density
If P = 0 Then
Density = 62.087 + 0.022519 * T - 0.00033873 * (T ^ 2) + 0.0000010579 * (T ^ 3)
Else
Density = 1 / V
End If
End Property
Property Get C() As Double 'Get Specific Heat
C = 1.0244 - 0.00071715 * pT + 0.0000061796 * (pT ^ 2) - 0.000000016397 * (pT ^ 3)
End Property
This problem went away. And KEEPS COMING BACK!!! I switched my computers out and it started working again. Now I have the same sort of issue and we tried it on 3 different computers here. same problem. I run the program and get overflow. but I can hold down F8 for 20 minutes and easily fly past the point at which it crashes. I am so tired of it. I want to use C# or C++ but unfortunately my company does not have licenses for it.
Custom Total
I am trying to create a function that would allow me to add together the value of whatever cell the formula is in for every sheet after it. For instance, I have a sheet called total that looks like every other sheet after it. I want cell c5 in the total sheet to be the sum of cell c5 in every other sheet. Here is my function:
Code:
Function AllSheets()
Application.Volatile True
Dim a As Variant
Dim Sht As Integer, ShtCount As Integer
Dim x As Integer
Dim Tempval As Long
Sht = ActiveSheet.Index
ShtCount = Sheets.Count
a = ActiveCell.Address
Tempval = 0
For x = (Sht + 1) To ShtCount
Tempval = Tempval + Sheets(x).Range(a).Value
Next x
AllSheets = Tempval
End Function
One obvious problem is that the range I am using (a) should not be based on the activecell, but whatever cell the formula is in. I do not know how to get that static address.
Additionally, do I need to make this volatile? It doesn't seem to recalculate on it's own, even with the volatile statement in there.
Lastly, is this just a terrible way to do what I am trying to do? This type of thing comes up for me all the time where we have a template that ends up generating dozens or more sheets that are all the same. Then if I want a total sheet I need to hit "=" and then the same cell in every sheet.
Thanks!
Cumulative Total
I attempted to find this answer through the search tool, but unfortunately had no luck.
I'm using excel and trying to figure out how to calculate a cumulative total. I posted on this VB forum because the closest I have gotten to completing this task is through the use of VB.
I have 2 columns in excel. I want to have one column be a running total/cumulative total(column B) and the other be that days entry(column A). If it were possible to do so, I would want the program to do this:
New B2=(previous B2)+(new A2)
Through the use of VB, macros, and sticky notes on the cell I was able to make this happen:
New B2=(previous B2)+(new action in B2)
This was achieved by getting excel to store the data in a non excel field(the sticky note area).
Any ideas on how to do this so that when a new value is entered in column A, column B's current total will be changed to the new total?
Thanks,
AE
Running Total
Hi there I have a list in column A (from A1 to A6) such as:
2
3
4
7
9
10
What I want to do is to loop through the column starting from A1 and add up each value to the last value such as 2+3+4+7+9+10 and I want the macro to highlight that row once the running total equals 25 or more. Therefore, the active row will be equal to 5.
Does anyone know how to complete this task without inserting a formula next to the column in question?
Total Percent
Hey all, im trying to code a percentage (discount) for my program...
This is my code thus far:
Code:
lblTaxTotal = "." & Format(txtDiscount.Text * lblTaxTotal, "0.00")
lblTaxTotal conbines the base price plus the tax.
txtDiscount.text stores the users % that is entered.
When i have a total of $5.88 i put in a %50 discount. After that the lblTaxTotal says ".294.00"
Also, when i have a total of $9.47 and i put in a %50 discount it has ".473.50".
How can i get this to format correctly?
Help Im Total Noob
hi im a total noob at vb so i was wondering how do you make your vb app into a different version (v1.1) (v2.0)
Please Help - Total Amateur! :P
hi there, before i tell you my exact problem, i will tell you the scenario just so you can see my point of view.
I have created a hurricane category program which asks the user for 9 locations, and 9 Speeds. Once they have done this there is another form which upon a click of a button, 4 list boxes are filled
Location
Speed
Category
Effects
there is a test which checks the speed to see which category it is, and what effects that category will have on the public (such as homes destroyed etc)
My problem is this:
The list box which displays the effects, is too small to fit all of the text.
so basically the effects continues in oneline, instead of columns
i know this doesnt make alot of sense so ill try again to explain it
this is how the text shows in the listbox:
Location speed category effects
a bb cc dddddddddddddddddddddddddddd
this is how i want it to be:
Location speed category effects
a bb cc dddddddddddd
dddddddddddd
1 idea is to have a label which changes upon selection, but i dont know how to do this
if anyone knows what im talking about, please help lol
VsFlexgrid Total
Hi
I have a VsFlexgrid 8 on my form with 3 columns, the grid is'nt bound to a database, which might make this a bit difficult, but in column 3 i add a currency from a command button ie $10,00. Is there a way to to get the sum of column3 and display it in a label.
Many thanks
A Running Total
Hi, consider myself an amatuer in VB and utterly stuck with my programming assessment. I'm working in VB 6 professional and as part of this assessment I have a form which sohws the various parts of a databse including one which holds a price. In this form I want another text box that (upon a button press) will add the price displayed from the database to a running total. Unfortunately I have absolutely no idea how to do this Can anyone help an utterly frustrated guy
Thanks
Get Total Question
I have a flexgrid on one of my forms. The last column gets hours and min. got from DateDiff from other columns. The last row of the last column gets the total from that column. The total is displayed something like this, 3.30. Three hours and thirty min.. The problem is, I'm not sure how to fix my code if the total is 3.80, three hours and 80 min.. Here is my code...
Code:
Public Sub OTHrsTotal()
Dim i As Integer
Dim lRunningTotal As Double
With Form9.TClockGrid
For i = 2 To 8 'Updates the Totals after add time to time sheet.
lRunningTotal = lRunningTotal + Val(.TextMatrix(i, 7))
Next i
If Str$(lRunningTotal) = "0" Then
.TextMatrix(9, 7) = ""
Else
.TextMatrix(9, 7) = Str$(lRunningTotal)
End If
End With
End Sub
Any help would be much appreciated.
If White, Add 1 To Total!
HI. Can someone please help me with a wee prob.
I have a speadsheet in Excel and some of the cells are grey and the others are white. (No cell is ever a fixed colour - they can be changed from grey/white to white/grey anytime the user likes).
The very last row of cells in my sheet remain white and this is the 'TOTAL' row.
What i am hoping to do is, the number of white cells in each column is to be displayed in the appropriate column in the 'TOTAL' row.
For example; if Column D had 7 white cells and 4 gray cells, then the number 7 will be displayed in the TOTAL row, in Column D. if Column J had 2 white cells and 8 gray cells, then the number 2 will be displayed in the TOTAL row, in Column J)
I've tried something like:
If Cells white Then
add 1 to TOTAL
The TOTAL row runs from D34 to AJ34
The areas that can be either colour run from D to AJ and down to row 33
Any help would be much appreciated
Thanks
Total Percentage?
I'm stuck again! I've got a program that gives the percent of profit for sales. In a year to date report, I want to show totals for the year: Sales, Profit and Percent of Profit. I've got the following code:
Code:
Dim A As Double, B As Double, C As Double, D As Double, E As Double
Dim F As Double, G As Double, H As Double, I As Double, J As Double
Dim K As Double, L As Double, M As Double
A = frmYearToDate.lblProfitPercent1.Caption
B = frmYearToDate.lblProfitPercent2.Caption
C = frmYearToDate.lblProfitPercent3.Caption
D = frmYearToDate.lblProfitPercent4.Caption
E = frmYearToDate.lblProfitPercent5.Caption
F = frmYearToDate.lblProfitPercent6.Caption
G = frmYearToDate.lblProfitPercent7.Caption
H = frmYearToDate.lblProfitPercent8.Caption
I = frmYearToDate.lblProfitPercent9.Caption
J = frmYearToDate.lblProfitPercent10.Caption
K = frmYearToDate.lblProfitPercent11.Caption
L = frmYearToDate.lblProfitPercent12.Caption
M = A + B + C + D + E + F + G + H + I + J + K + L
frmYearToDate.lblTotalPercent.Caption = Format(M, "###,###.##") & "%"
In this case, frmYearToDate.lblProfitPercent1.Caption is 38.94%, but when I run this line to debug, A still = 0. What am I doing wrong?
Total Compiling
How I can compile a program without use extra DLL, or include this DLL's into the EXE, the idea is ensure that the EXE always execute. Example: All programs needs vb6es.dll, how I can include vb6es.dll into EXE program. ?
Thanks
Keep A Running Total
Hi: Using VB6, ADO 2.7
I have a form with seven text box fields. All will contain numeric entries.
As the user keys in any of the boxes I would like to keep a running total.
If after entries are made and any changes are made I need to update that total.
I can currently get the correct total with a command button, but
would like to get it while entries are made. Can someone tell me what
event I need to use to achieve this?
Thanks for your responses
Total Value Of String
I know this must be really, really simple, but I am just starting out with VB, and will probably need a lot of help.
I need to find the total value of a string - the user types in a series of numbers into the text box, and I need to add them as if they are all individual numbers
eg, the user types in 2563, the total is 16
help please!!
Total Boxes?
How would i code a sub total label, and then a total box affected by a discount and vat
Help appreciated
Total Problem
--------------------------------------------------------------------------------
I have a form that looks up data and it displays the data in a vsflex grid. Now i have a paid field. How can i display the total of that paid field in a lablel or a text box on the form?
So if for joe smith their was
10
20
30
in the vsflexgrid
there would be a text box that shows $60 on the form
??
Thanks
Get Total Before This Page
Hey,
When i'm on page 7 i would like to now what the total is of a product until page 6. I made a cross query and that get's the total of all pages. But i want to show on each page the total of the page before.
|