473,379 Members | 1,330 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,379 software developers and data experts.

Help - VB Code for excel QTY Sum

9
I am working in excel and I am new to visual basic, but I think there is a simple code for my problem.

In column "J" I have Part Number
In column "N" I have QTY

In column "Q" I have an "=if(mid)" statement that displays Part number for only the first part number in column "J" where the part number is different from the previous part number. this column is sorted.

In column "R" I have a sum of QTY (column "N") for the corresponding Part Numbers.

Can someone help me with code that will sum the QTY of column "N" while column "Q" is blank (but also including that first base part)

Maybe a macro is necessary?

thank you
Mar 5 '08 #1
2 1244
First reply to this forum, so pardon if I mess up the formatting.

Usually, in this situation, I would introduce an additional column, and then hide it. So.... add a new column (for argument sake, I'll call it column O). Every cell in the column can have a formula like:

Expand|Select|Wrap|Line Numbers
  1. =If($N2 = "", $O1 + 1, 0)
  2.  
That way, you'll have a column with a running tally of each part number. From there, it should be pretty easy to nail the cells you want.
Mar 6 '08 #2
jball
9
Sorry, but that does not seem to work.
N2 always has a QTY.
I changed "N" to "Q" because that number shows only when the part number changes, but when I include the rest of the formula, I get that QTY +1, not QTY + QTY from the row above. Maybe I do not understand something...
Anymore help is appreciated.
Thank you,
Mar 6 '08 #3

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

Similar topics

4
by: Marc | last post by:
Hi all, I am trying to write an application where I need the ability to open an Excel spreadsheet and do basic read/write, insert rows, and hide/unhide rows. Using win32com I have been able to...
9
by: Edward S | last post by:
I budget for a Project in an Excel sheet as illustrated below. The months below are usually a 2 year period i.e. 24 months, though it could be over 24 months depending upon a Project. I then...
4
by: JonathanParker | last post by:
Looking for some help urgently with some VB SQL Access stuff. You'll have to excuse the messiness of the code, I'm a newbie at all this. I'm running this code with a selection of check boxes to...
1
by: Coleen | last post by:
To export data from a datagrid to an excel file. I am using VB.net/ASP.net v 2003, and not connecting to an SQL database. I have an existing datagrid that I want to get the data from and download...
2
by: shapper | last post by:
Hello, I am for days trying to apply a XSL transformation to a XML file and display the result in a the browser. I am using Asp.Net 2.0. Please, could someone post just a simple code example,...
9
by: pic078 via AccessMonster.com | last post by:
I need serious help - I have a frontend/backend Access database (2 MDE Files) that remains stuck in task manager after exiting the application - you can't reopen database after exiting as a result...
0
by: santu07 | last post by:
I am trying to export data from Excel11.0 object to datatable using C#. I can't properly open workbooks. Can anyone please help me to fix this error. I got the above error when i try to open the...
0
by: hitencontractor | last post by:
I am working on .NET Version 2003 making an SDI application that calls MS Excel 2003. I added a menu item called "MyApp Help" in the end of the menu bar to show Help-> About. The application...
1
by: ISATownsME | last post by:
HELLO world, this is my first post and heres my problem. I have an excel spreadsheet with 22 columns, and undefined amount of rows. I need vb.net to read the data from excel. Then use that data to...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.