Hi,
I am making a script to help print labels from data in excel the first step is getting the data from excel and separating it and getting the data from cells that are not next to each other.
For example in column A there is an Order Number then in B, C, D there is just data that isn’t needed for the labels then in E there is the product code and in F, G or H there is the amount of the product needed depending on the size.
I have tried using CMD and select and getting the script to return the values but it only gets the value of the first selected cell.
Here is an example of the data that would be fetched:
Order No.>Product Code>amount
1234 AA-BB-CC-D 15
I need the user to be able to select the information needed as the pending sheet changes every day so the information everyday is on different rows.
and I want to be able to separate the returned information for example:
set a to 1234
set b to AA-BB-CC-D
set c to 15
and then separate the value of “b”
set b1 to AA
set b2 to BB
set b3 to CC
this is because the majority of the product code relays to the product description which is also the label I want to print out.
here is the code that I have which returns the value of the cells at the moment but it only works if the cells are next to each other:
tell application "Microsoft Excel"
set c to value of selection
end tell
return c
I know it is a tall order for the OP but any help will be greatly appreciated!
Thanks,
Bruce
EDIT:
I have set c to cells of selection which returns the cell letters and numbers but when I try to return the value of those I get the error
but only one of those cells is correct “K23” the other values should be F23 and A23 anybody know why this is?
Thanks again,
Bruce