Hi
I am helping my local historical society in a voluntary capacity to get their website on line. It will contain a catalogue of 400-500 documents. I have a list of them which I can get into excel.
In excel they appear as: column 1, a code for where they are in the filing cabinets, eg FC029-1,In column 2 is the document title.
Some have been digitised and the url consists of the ref code and title, as several of the ref codes are the same.
I have been trying to come up with a macro to update the ref code to of each document to make it unique. Thereby using only the new ref code as the url
I lack the knowledge of VBA Syntax to achieve this, but my thoughts are of a 1 to last row loop containing another loop that adds a char to the cell and the updates the char to next add if the ref is the same, then goes back to the first loop till all ref codes are different
So, something like
For i = 1 to lastrow
Z=cell(i,1)
C=65
For j=i to lastrow
If Cell( j,1)=Z
Then
( Cell(j) = Z & Chr(C)
C=C+1 )
Next
Next
Any help with the practical and correct syntax of the above will be gratefully received. Any comments about the logic or lack of it also welcome
I am helping my local historical society in a voluntary capacity to get their website on line. It will contain a catalogue of 400-500 documents. I have a list of them which I can get into excel.
In excel they appear as: column 1, a code for where they are in the filing cabinets, eg FC029-1,In column 2 is the document title.
Some have been digitised and the url consists of the ref code and title, as several of the ref codes are the same.
I have been trying to come up with a macro to update the ref code to of each document to make it unique. Thereby using only the new ref code as the url
I lack the knowledge of VBA Syntax to achieve this, but my thoughts are of a 1 to last row loop containing another loop that adds a char to the cell and the updates the char to next add if the ref is the same, then goes back to the first loop till all ref codes are different
So, something like
For i = 1 to lastrow
Z=cell(i,1)
C=65
For j=i to lastrow
If Cell( j,1)=Z
Then
( Cell(j) = Z & Chr(C)
C=C+1 )
Next
Next
Any help with the practical and correct syntax of the above will be gratefully received. Any comments about the logic or lack of it also welcome