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 / Programming / March 2006

Tip: Looking for answers? Try searching our database.

paste to next free colum on new Worksheet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ralph - 22 Mar 2006 11:07 GMT
Hi,
I have a sheet with one colum of results, those results I would like to
paste onto the next worksheet into the frist empty colum after the data of
the previous results, in order to create a kind of history.
Martin - 22 Mar 2006 12:29 GMT
Try this:

Sub PasteColumn()
   Dim myRange As Variant
   Dim mySheet As Worksheet
   Set mySheet = Worksheets("Sheet2")
   Set myRange = mySheet.Range("A1").CurrentRegion
   If myRange.Cells.Count > 1 Or (myRange.Cells.Count = 1 And
myRange.Cells(1).Value <> "") Then
       Set myRange = myRange.Offset(0, myRange.Columns.Count).Resize(1, 1)
   Else
       Set myRange = mySheet.Range("A1")
   End If
   Worksheets("Sheet1").Columns(1).Copy (myRange)
End Sub

> Hi,
> I have a sheet with one colum of results, those results I would like to
> paste onto the next worksheet into the frist empty colum after the data of
> the previous results, in order to create a kind of history.
 
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.