'For Each Shortcut Key Press Copy Column To The Right
Okay so below you can find a screenshot and the code I have.
Basically, I have two workbooks
- What I have is workbook where I have macro with a shortcut (CTRL-SHIFT-M) this macro needs to open second workbook (data.xlsm) select and copy the first column, 01/15 (as you can see below), then I will need to do something manually with the copied content, and after I press the shortcut again, it will move onto another column -> to the right and again select and copy that column, and repeat.
My sheet with columns
My code:
Sub Copy_From_Another_Workbook()
Copy_From_Another_Workbook Macro
Keyboard Shortcut: Ctrl+Shift+M
Dim radky As Range
Set radky = Range("I04:I409")
souborData = "C:\Users\cza19785\Desktop\Data.xlsm"
souborReport = "C:\Users\cza19785\Desktop\konsolidovaný report_VBA.xlsm"
Workbooks.Open (souborData)
Set souborData = ActiveWorkbook
radky.Select.Copy
End Sub
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

