Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Setup / January 2006

Tip: Looking for answers? Try searching our database.

Help with a macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
peter - 22 Jan 2006 23:11 GMT
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
Gary''s Student - 23 Jan 2006 00:37 GMT
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

Signature

Gary''s Student

> 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
[quoted text clipped - 5 lines]
>
> Peter
peter - 23 Jan 2006 23:59 GMT
Ok, Gary, I'll give it a try at work tomorrow.

Thanks a lot!

Peter
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.