Reputation: 1258
I am fairly new to VBA I figured out how to copy a cell value from one workbook to another assuming the location of the destination cell is known.
What i need is for the user to select a single cell in a worksheet and when a command button attached to a macro is clicked data from a fixed location is copied to that cell.
I would really appreciate any suggestions...
I need to open a new workbook and copy cell / named range then come back to original workbook and paste in the location that was selected by the user. In case of range the selected cell is taken as starting cell.
Upvotes: 0
Views: 1823
Reputation: 1258
I used following method to solve my problem..
I passed the row & column index to the function that handles the copying To get the cell index
Activecell.row
Activecell.column
Then pasted to that location as follows...
ThisWorkbook.Worksheets(<worksheetname>).Cells(row,column).pastespecial
Upvotes: 0