I have a spreadsheet which contains catalogue numbers in Column A and titles in Column B. In Cell E1 I also have a formula that counts the number of rows that have been entered in the spreadsheet.
What I need to do is to extract each cell from both columns and store as a variable so that I can then use them independently and together in other parts of the macro later on.
This is my code so far:
Code: Select all
//Locate Spreadsheet of DMO Titles
//ask for location of spreadsheet.
Input>file_name,Please Browse To The Spreadsheet Containing The Headings,
//get the file name on its own
Separate>file_name,\,parts
Let>xls_name=parts_%parts_count%
//get number of titles. Spreadsheet must be open!
DDERequest>Excel,xls_name,R1C5,title_no,60
//Remove invisible characters from spreadsheet value. NEEDED!
StringReplace>title_no,tab,,title_no
StringReplace>title_no,cr,,title_no
StringReplace>title_no,lf,,title_no
//Extract TB Numbers & Titles from spreadsheet
Let>k=0
Repeat>k
Let>k=k+1
Let>row=k+1
DDERequest>Excel,xls_name,R%row%C1,TB_no_%k%,60
DDERequest>Excel,xls_name,R%row%C2,Book_Name%y%,60
Until>k=title_no
//Test to see if it worked
MessageModal>%TB_no_1% %Book_Name1%