I use range and type in the cell location which requires an incrementor going downwards.
Highlight a price in a cell that is different from the same item
All or some of the prices need to be highlighted in some form or another.
VB
Office Development
-
LesHay • 7,136 Reputation points
2022-03-25T21:03:48.373+00:00 Hi
Take a list of numbers. How do you decide which number must be used to compare other to?
Essentially, most of the numbers in the list can be said to be different to one of the others.
You must define the exact rules that need to be used to 'highlight' a number.
-
Jonathan Brotto • 1,076 Reputation points
2022-03-26T18:30:23.997+00:00 It will be the part number.
-
LesHay • 7,136 Reputation points
2022-03-26T18:33:36.037+00:00 Hi
Well, thanks for the extensive explanation.
Is there a shortage of words in your neck of the woods? What about the request or you to define the exact rules? -
Jonathan Brotto • 1,076 Reputation points
2022-03-26T18:39:33.38+00:00 I am looking at part number as group where it will compare all the prices and highlight them if there is a difference.
-
LesHay • 7,136 Reputation points
2022-03-26T19:03:55.873+00:00 Hi
Using the image you posted above, in the part number column, which would you highlight manually if it was on paper? Describe the RULES YOU FOLLOW to do so! -
Jonathan Brotto • 1,076 Reputation points
2022-03-28T13:29:55.123+00:00 I am thinking the rule to be something like this. If part number above is the same then compare the previous price above. If they are different then highlight.
-
LesHay • 7,136 Reputation points
2022-03-28T13:40:49.33+00:00 Ho
OK, a little progress. Now, what are you using to display the data = a DataGridView perhaps?
Also, following your comment, is this correct:- Starting at bottom of Part Number column
let x = 1 - compare bottom number with bottom-x number
- if same, x = x + 1, repeat using bottom-x until top reached or difference found
- if different then highlight cell, x = x + 1 and goto (3)
EDIT: ignore the spurious bullet numbers this editor insists on inserting.
- Starting at bottom of Part Number column
-
Jonathan Brotto • 1,076 Reputation points
2022-03-28T13:41:57.197+00:00 Put an if statement within a while statement going downwards?
-
LesHay • 7,136 Reputation points
2022-03-28T13:45:45.54+00:00 Hi
What container are you using - a DataGridView?
And no, I would rather start at the bottom and work up, but it can be done top down too.
Sign in to comment
1 answer
Sort by: Most helpful
-
Jonathan Brotto • 1,076 Reputation points
2022-03-28T13:47:00.47+00:00 -
LesHay • 7,136 Reputation points
2022-03-28T13:48:09.163+00:00 Hi
Are you doing this within an Exel spreadsheet? -
Jonathan Brotto • 1,076 Reputation points
2022-03-28T13:49:41.167+00:00 I was thinking a VSTO project where I code the action in VS, but open to anything.
-
LesHay • 7,136 Reputation points
2022-03-28T13:55:23.007+00:00 Hi
If you are or intend to use anything other than VB, then I will leave it for someone else as I do not use Office at all. Other contributors here may help.
What is the format of the data you are using? Is it just data typed in and saved from Exel?
-
Jonathan Brotto • 1,076 Reputation points
2022-03-28T13:59:19.21+00:00 An export file from our ERP .xlsx
-
LesHay • 7,136 Reputation points
2022-03-28T14:02:47.847+00:00 Hi
OK, I will bow out then. It seems that you intend to use a combination of VB and Excel for you project. There are a number of contributors here who are much more able to assist.
Sign in to comment -