ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   increment cell value based on another cell's value (https://www.excelbanter.com/excel-programming/413409-increment-cell-value-based-another-cells-value.html)

Rosa Hildur

increment cell value based on another cell's value
 
I have a workbook.
1 sheet I enter a number in one column, and the next column uses vlookup to find the previous cell's value in the second sheet and get the value in the column next to it.

Basically it's like:
Sheet 1:
12345 vlookup finds value "apple" based on the number in the previous cell
78912 vlookup finds value "cucumber" based on the number in the previous cell

Sheet 2:
12345 apple
45678 orange
78912 cucumber

I have a macro that automatically prints a required amount of copies of Sheet 1. What I want to do is add a new column in Sheet 2 that counts the amount of times each "product" has been selected. So what I'm saying is that I want to add a function to the printing macro that increments the number in the new third column next to all the products selected in the first sheet.

Anybody understand what I'm trying to ask... :-S

TomPl

increment cell value based on another cell's value
 
I think I understand what you want. If so, you could add code to the print
macro that would cycle through the selected cell on column a, sheet 2 and add
one to the value in column c, sheet 2. I assume that you want the values
incremented each time the print macro is run.

"Rosa Hildur" wrote:

I have a workbook.
1 sheet I enter a number in one column, and the next column uses vlookup to find the previous cell's value in the second sheet and get the value in the column next to it.

Basically it's like:
Sheet 1:
12345 vlookup finds value "apple" based on the number in the previous cell
78912 vlookup finds value "cucumber" based on the number in the previous cell

Sheet 2:
12345 apple
45678 orange
78912 cucumber

I have a macro that automatically prints a required amount of copies of Sheet 1. What I want to do is add a new column in Sheet 2 that counts the amount of times each "product" has been selected. So what I'm saying is that I want to add a function to the printing macro that increments the number in the new third column next to all the products selected in the first sheet.

Anybody understand what I'm trying to ask... :-S



All times are GMT +1. The time now is 11:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com