Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.setup
|
|||
|
|||
Help with a macro
I am tring to write a macro that opens a sheet and copies cell from it
to my original sheet. The copied cells are in the same place on the sheet, but the thing is, the name of the sheet changes. I guess what I'm asking is is there a way to have it prompt me for the name of the sheet I'm going to copy from? Thanks, Peter |
#2
Posted to microsoft.public.excel.setup
|
|||
|
|||
Help with a macro
Try:
Option Explicit Sub CopyFromPasteTo() Dim strF As String Dim strT As String Dim rngF As Range Dim rngT As Range strF = Application.InputBox("Enter from range", Type:=2) Set rngF = Range(strF) strT = Application.InputBox("Enter goto range", Type:=2) Set rngT = Range(strT) rngF.Copy rngT End Sub -- Gary''s Student "peter" wrote: I am tring to write a macro that opens a sheet and copies cell from it to my original sheet. The copied cells are in the same place on the sheet, but the thing is, the name of the sheet changes. I guess what I'm asking is is there a way to have it prompt me for the name of the sheet I'm going to copy from? Thanks, Peter |
#3
Posted to microsoft.public.excel.setup
|
|||
|
|||
Help with a macro
Ok, Gary, I'll give it a try at work tomorrow.
Thanks a lot! Peter |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Search, Copy, Paste Macro in Excel | Excel Worksheet Functions | |||
Can T Get Macro To Run! | New Users to Excel | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) |