Hello
I have a column in Excel with a reference number, where I need to add some letters.
The values in the column would look like this now: 201, 202, 203, 204 etc
and I need to change it to look like this: 201ND700, 202ND700, 203ND700, 204ND700 etc
I can get it to work on single cells :
tell application "Microsoft Excel"
set V to "ND700" as text
set B to value of cell "A1" as text
set value of cell "A1" to B & V as text
end tell
How can I run through every cell in column A and add “ND700” ?
This is only a part of a bigger script where I need to rename a bunch of folders with values from the same excel document. It is a lot easier to match the folders if I could add those characters to the cells in that column…
tell application "Microsoft Excel"
set V to "ND700" as text
set B to (get value of range "a1" as text)
get value of range "a1"
set value of cell 1 of range "a1" to B & V as text
end tell
sorry, didn’t read your question right. Just finished a shutdown and I was in zombe state.
Anyways heres the repeat statement.
tell application "Microsoft Excel"
activate
set ur to range (get address of used range of active sheet) of active sheet
repeat with rowNum from 1 to count of rows of ur
set oneRow to get resize (row rowNum of ur) column size 1
set B to (get value of oneRow)
set V to "ND700" as text
set value of cell 1 of oneRow to B & V as text
end repeat
end tell
Yes! Thank you bills! I have been away for a few days, so I didn’t see this before now. This does what I need it to do, but I have some problems with some cells ending up like : 201,0ND700, so 201 is obviously read as a number with a decimal… I’ll look at it more tonight Thanks!