Adding letters to cells of column in Excel

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” ?

Meech

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…

Thanks

Hi
here’s a start

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

You will need a repeat statement
regards
bills

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

hope this is what you want
bills

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 :slight_smile: Thanks!

hi
glad it helped, to get rid of the decimal, change this line

set B to (get value of oneRow)

to this

set B to (get value of oneRow) as integer

regards
bills

Thank you so much, bills. That solved it :slight_smile: