![]() |
| |||||||
Automation Anywhere Post messages and questions related to Automation Software here. |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| I receive a new excel spreadsheet on a daily basis which has one of 20 possible headings in cell A2. One of the tasks that I need to do is run one of 20 macros that are stored within excel by typing a hotkey. The macro that I run is determined by the name of the heading in cell A2. Using AA, I am attempting to automate the following tasks: 1) Identify the heading name in cell A2 for each spreadsheet. 2) run the corresponding macro using the proper hotkey. 3) should the heading not match any of the 20 headings (for example it was misspelled) then pause the task and prompt me to press the hotkey. 4) once the hotkey is pressed, the task resumes. Any help in accomplishing this is greatly appreciated. |
| |||
| Hi, Is this an actual heading in excel, or a cell value that you can copy. If you can copy it, you could use AA to click on the cell you need, type a keystroke in your script to copy the value to memory (CTRL+C), and then in your script have IF statements "IF $clipboard$ = x" run macro x, etc. |
| |||
| Hello, What we understand you have an excel workbook with 20 different sheets and excel macro. You want to run the excel macro according to the heading in cell A2 of active sheet. Right? To run the excel macro according to the heading in cell A2, what you can do is go to Tools-> Task Editor to create a new task. In editor create a task as follows: 1)Using ‘Insert Keystroke’ command apply CTRL+g to go to cell A@ 2)Copy the cell by applying F2, Shift+Home, then CTRL+c 3)Use ‘If-Variable’ command to check ‘If $Clipboard’ equals to “some text” then apply hotkey accordingly. The task would look something like as follows: Keystrokes: [CTRL DOWN]g[CTRL UP] in "Microsoft Excel - wksplog" Keystrokes: A2[ENTER] in "Go To" Keystrokes: [F2][SHIFT DOWN][HOME][SHIFT UP] in "Microsoft Excel - wksplog" Delay: (200 ms) Keystrokes: [CTRL DOWN]c[CTRL UP] in "Microsoft Excel - wksplog" Delay: (100 ms) If $Clipboard$ Equal To "abc" Then //If Cell A = “abc” Message Box: "Macro 1" //Run Macro 1 End If If $Clipboard$ Equal To "def" Then Message Box: "Macro 2" End If Hope that helps. |