Duckbill32
New Member
- Joined
- Dec 28, 2022
- Messages
- 9
- Office Version
- 2021
- Platform
- Windows
Hi there!
I am trying to come up with a macro, what would deduct cell values from the certain cells, depending on their existence.
In the example before, one can see data in the D column for the for the data points "1" and "2" in the C column. Those data points belong to the specific file, named in the B column (they are not necessarily named "Image1" etc.). There are always two data points "1" and "2" for one file name.
I am trying to build a macro that would calculate the difference between the data point and write it in the G column. In the example below, one can see G3=D4-D3, similarly G5=D5-D4 etc. The though part, however, is that the amount of files (not data points) may vary. On the screenshot, there are three files, but there could be one or hundred.
Therefore, I am trying to come up with some sort of IF function inside the macro, that would first analyze how many lines with values there are in D column from D3 until blank cell (D9 in the example below). Then, it would deduct the second data point value from the first one for each file name and write the results in the G column. It could also put the file name in front of the result, for example in the F column, e.g. Image 1 = -2.54E-08.
Any help would ne much appreciated
Thank you excels, macros and VBAs professionals!
I am trying to come up with a macro, what would deduct cell values from the certain cells, depending on their existence.
In the example before, one can see data in the D column for the for the data points "1" and "2" in the C column. Those data points belong to the specific file, named in the B column (they are not necessarily named "Image1" etc.). There are always two data points "1" and "2" for one file name.
I am trying to build a macro that would calculate the difference between the data point and write it in the G column. In the example below, one can see G3=D4-D3, similarly G5=D5-D4 etc. The though part, however, is that the amount of files (not data points) may vary. On the screenshot, there are three files, but there could be one or hundred.
Therefore, I am trying to come up with some sort of IF function inside the macro, that would first analyze how many lines with values there are in D column from D3 until blank cell (D9 in the example below). Then, it would deduct the second data point value from the first one for each file name and write the results in the G column. It could also put the file name in front of the result, for example in the F column, e.g. Image 1 = -2.54E-08.
Any help would ne much appreciated
Thank you excels, macros and VBAs professionals!