Sum columns with code?

  • Thread starter Thread starter idta
  • Start date Start date
I

idta

Hi there, I have a table full of numbers. I want to delete all the
columns that do not have ANY numbers in the rows under the column. I
assume I could sum the column, and if the sum is 0, I know there are no
vaules in the column. I then could delete this column and move on to
the next column.

Anybody know the commands to sum the column, and proceed to the next
one (without knowing the name of the next column)? If not, I could
always hardcode the name of the column and loop it, but that would be a
nice feature.

I have a rough idea of how to delete and progress through the table.
But how do I perform a sum?

Thanks.
 
Hi there, I have a table full of numbers. I want to delete all the
columns that do not have ANY numbers in the rows under the column. I
assume I could sum the column, and if the sum is 0, I know there are
no vaules in the column. I then could delete this column and move on
to the next column.

Anybody know the commands to sum the column, and proceed to the next
one (without knowing the name of the next column)? If not, I could
always hardcode the name of the column and loop it, but that would be
a nice feature.

I have a rough idea of how to delete and progress through the table.
But how do I perform a sum?

Thanks.

Do you want to do this on a regular bases or do you have that many
fields (spreadsheets have columns, databases have fields).

If you have that many fields it sounds like you need to re-design your
table(s)

Consider making a query that sums all fields you are interested in.
 
Yes, by default there are that many fields for the user to input
information.

I'd prefer to do this via code and not a query because I have many
fields.

Thanks.
 
Yes, by default there are that many fields for the user to input
information.

I'd prefer to do this via code and not a query because I have many
fields.

Thanks.

When you have many fields (how many is many?) most of the time it is the
result of poor table design. For example it would generally be incorrect to
use 31 fields to enter data for each moths activity. Likewise it would
generally be a bad idea to have 14 fields to enter data about 14 employees.

This poor table design causes all kinds of problems, not apparent at
first. It is the way a spreadsheet is constructed, but not the way a
database should be constructed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top