#1   Report Post  
Posted to microsoft.public.excel.setup
peter
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.setup
Gary''s Student
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.setup
peter
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Search, Copy, Paste Macro in Excel [email protected] Excel Worksheet Functions 0 January 3rd 06 06:51 PM
Can T Get Macro To Run! Nipper New Users to Excel 2 November 4th 05 04:48 AM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM


All times are GMT +1. The time now is 07:44 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"