Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This is probably a simple question, but I can't seem to figure it out...
I want to run a task of pasting several rows and columns of information into a cell that is selected by the user. I recorded a Macro and asigned it to a rectangular button that will copy the information, but how can I make it paste the information starting in the selected cell? Thanks in advance. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
dim RngToCopy as range
Set rngtocopy = worksheets("sheet99").range("a1:b99") 'or something rngtocopy.copy _ destination:=activecell ========= You could even ask where it should be pasted: dim RngToCopy as range Dim DestCell as range set destcell = nothing on error resume next set destcell = application.inputbox(prompt:="select a cell",type:=8).cells(1) on error goto 0 if destcell is nothing then exit sub 'user hit cancel end if Set rngtocopy = worksheets("sheet99").range("a1:b99") 'or something rngtocopy.copy _ destination:=destcell Steve wrote: This is probably a simple question, but I can't seem to figure it out... I want to run a task of pasting several rows and columns of information into a cell that is selected by the user. I recorded a Macro and asigned it to a rectangular button that will copy the information, but how can I make it paste the information starting in the selected cell? Thanks in advance. -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank you Dave.
"Dave Peterson" wrote: dim RngToCopy as range Set rngtocopy = worksheets("sheet99").range("a1:b99") 'or something rngtocopy.copy _ destination:=activecell ========= You could even ask where it should be pasted: dim RngToCopy as range Dim DestCell as range set destcell = nothing on error resume next set destcell = application.inputbox(prompt:="select a cell",type:=8).cells(1) on error goto 0 if destcell is nothing then exit sub 'user hit cancel end if Set rngtocopy = worksheets("sheet99").range("a1:b99") 'or something rngtocopy.copy _ destination:=destcell Steve wrote: This is probably a simple question, but I can't seem to figure it out... I want to run a task of pasting several rows and columns of information into a cell that is selected by the user. I recorded a Macro and asigned it to a rectangular button that will copy the information, but how can I make it paste the information starting in the selected cell? Thanks in advance. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
copying cell names | Excel Discussion (Misc queries) | |||
Macro running when a cell is exited | Excel Discussion (Misc queries) | |||
macro help | Excel Discussion (Misc queries) | |||
Possible Lookup Table | Excel Worksheet Functions | |||
how read value from last selected cell? It is possible? how get adress last selected cell? | New Users to Excel |