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 / New Users / May 2008

Tip: Looking for answers? Try searching our database.

scrolling down

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Madhup Thakur - 30 May 2008 19:41 GMT
While trying to record a macro I need to fulfill the following task, Chose a
sheet go to the last cell move up using the control+UpArrow, then use the
down arrow to go a vacant cell to perform the copy paste operation.A part of
the macro reads like this

Sheets("Sheet3").Select
Application.Goto Reference:="A65536"
Selection.End(xlUp).Select
Range("A3").Select

However the DownArrow gives me a direct cell reference instead of scrolling
like [Range("A3").Select ]causing data paste errors. How do i sort this out
M. Thakur
Dave Peterson - 30 May 2008 20:55 GMT
You don't need to use the .select's:

Dim RngToCopy as range
Dim NextCell as range

with worksheets("sheet3")
 set NextCell = .cells(.rows.count,"A").end(xlup).offset(1,0)
end with

with worksheets("someothersheet")
 set rngtocopy = .range("somerangehere")
end with

RngToCopy.copy _
 destination:=NextCell

> While trying to record a macro I need to fulfill the following task, Chose a
> sheet go to the last cell move up using the control+UpArrow, then use the
[quoted text clipped - 9 lines]
> like [Range("A3").Select ]causing data paste errors. How do i sort this out
> M. Thakur

Signature

Dave Peterson

Madhup Thakur - 31 May 2008 02:52 GMT
Thanks a lot Dave,

Being simple I had chosen to use the Macro Record facility in XL2003. The
script that came out was the one that I stated. Your help has been very
gratifying.
Regards.
M.
> You don't need to use the .select's:
>
[quoted text clipped - 12 lines]
>  destination:=NextCell
> Dave Peterson
 
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.