Hello all,
I hate coming to a new forum requesting help without giving out something first, but I'm in a time crunch and I figured I would double the efforts once things die down here. I took c# programming in college, but it's been a while sense I've touched the class's and I remember even less VBA. I have a question on how to preform the following action in a macro;
My work book has 4 columns;
Column A - 2 letter id (not needed for macro)
Column B - Image Key (This number starts at 001 and continues down each row constantly incrementing itself by one.)
Column C - Contains either the letter 'F' or is blank to denote the attribute of the Image Key in Column B.
Column D - The blank area the macro will output the information.
Now for the meat of the Macro, Basically I need the Macro to start off with the following String Format Exhibit Number _ Page Number (ex. 0001_001). The first portion of the number "0001" denotes the exhibit the image key comes from, the second portion "001" denotes the page. . The qualifier in Column C denotes the break between exhibits. As an example, cell c6 contains 'F'. I need the Macro to recognize that the F is there, Not output information into d6, but instead continue the format down to d7.
The Macro should start out by searching for the first F, and outputting the 0001_001 into the d column one row down. Then check the next row in the C column and see if theres an F, if not it should increment the Second Portion of the the format by 1. Once it discovers an F, stop incrementing the second portion, add one to the end of the first portion and begin checking again.
To reiterate;
Starts with a value of 0000_000
Macro detects an F in C1, Increments the first number by one (internally) and resets the page number > 0001_000
Macro Scans next cell down in column C, C2 detects a blank cell > outputs 0001_001 into D2
Macro Scans next cell down in column C, C3 detects a blank cell > outputs 0001_002 into D3
Macro Scans next cell down in column C, C4 detects an F > Increments the first number by one (internally) and resets the page number > 0002_000
Macro Scans next cell down in column C, C5 detects a blank cell > outputs 0002_001 into D5
This would repeat until it comes to a completly blank row.
As a qualifier, there will never be 2 rows with adjacent F's, theres always a page between the exhibit markers.
Please help!
Thank you so much in advance,
Colin
Bookmarks