473,405 Members | 2,334 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

HOW TO COUNT DATA in MSFlexgrid

i have import excel data in MSflexgrid.. Now i want to count the data for particulars fields...

Like Data have four column A, B, C and D
while using A column, i have to calculate the data of B column..
plz give me .. code for this...

Thanx
Apr 9 '07 #1
4 6579
Dököll
2,364 Expert 2GB
i have import excel data in MSflexgrid.. Now i want to count the data for particulars fields...

Like Data have four column A, B, C and D
while using A column, i have to calculate the data of B column..
plz give me .. code for this...

Thanx
Hello uprakash14!

You've come to the right place, you'll have to tell us a little more. Do you have anything working this very minute. You can help avoid confusion if your code is posted, especially in the event one needs to post a tutorial to help you figure this all out.

Please stay tuned and good luck.
Apr 10 '07 #2
Hello uprakash14!

You've come to the right place, you'll have to tell us a little more. Do you have anything working this very minute. You can help avoid confusion if your code is posted, especially in the event one needs to post a tutorial to help you figure this all out.

Please stay tuned and good luck.

i am doing work with excel .. i have imported excel file in MSflexgrid... Now i have prob is that i have to count the records. or we can say that .. count the cells of that excel file. using diff colunm taking into consideration...

thanx
Apr 10 '07 #3
Dököll
2,364 Expert 2GB
i am doing work with excel .. i have imported excel file in MSflexgrid... Now i have prob is that i have to count the records. or we can say that .. count the cells of that excel file. using diff colunm taking into consideration...

thanx
Splendid, this means you have a working code. Mind posting it!

You will get better, sound results that way...
Apr 15 '07 #4
cmrhema
375 256MB
i am doing work with excel .. i have imported excel file in MSflexgrid... Now i have prob is that i have to count the records. or we can say that .. count the cells of that excel file. using diff colunm taking into consideration...

thanx
This is not my code but try it out(or you can modify)
=======
Here is a function that accepts a grid control and a column number. It then
totals all the rows of the column and returns the total in the name of the
function. You can probably use or modify this code to do what you need:


Public Function getGridColumnTotal(myGrid As Control, myColumn As Long) As
Single


'Calculate and return the total of all the cells in a grid's column.
'The grid to use is passed into the function as myGrid.
'The column to use is passed into the funcion as myColumn.


Dim counter As Integer, myTotal As Single, myCell As Single


'turn on an error handler
On Error GoTo getGridColumnTotalError


'set the grid's column to the argument passed into the function
myGrid.Col = myColumn


'loop through all the items in the grid
For counter = 0 To myGrid.Rows - 1
'set the grid's row to the counter
myGrid.Row = counter
'if the text in the current cell is numeric
If IsNumeric(myGrid.Text) Then
'retrieve the current cell (pointed to by the grid's Row and Col
properties
myCell = myGrid.Text
'add the cell's contents to a running total
myTotal = myTotal + myCell
End If
Next counter
'return the grid column's total in the name of the function
getGridColumnTotal = myTotal


'exit to keep from falling into the error handler
Exit Function
getGridColumnTotalError:
'use a message box to indicate an error number and error description
MsgBox Err & Error, vbCritical, "getGridColumnTotal Error"


End Function
Apr 16 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: MouseHart | last post by:
I've written a simple program in VB 6.0 to list all my MP3 files. To show them on the screen I used an MSFlexGrid named TextGrid (which is not associated with any table or text file) in the...
0
by: Martin K | last post by:
Hello all..thanks for everyone's advice regarding my SHBrowseForFolder API problem, I was able to put together a public class that runs great! But I have another migration headache regarding the...
0
by: Martin K | last post by:
Hello all..thanks for everyone's advice regarding my SHBrowseForFolder API problem, I was able to put together a public class that runs great! But I have another migration headache regarding the...
0
by: Martin K | last post by:
Hello all..thanks for everyone's advice regarding my SHBrowseForFolder API problem, I was able to put together a public class that runs great! But I have another migration headache regarding the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.