PC Review


Reply
Thread Tools Rate Thread

Copy Rows From Worksheet Into Another Worksheet Same Workbook

 
 
=?Utf-8?B?Sm9lIEsu?=
Guest
Posts: n/a
 
      7th Oct 2007

Please help me modify the movesheet macro listed below to start on row 10 on
the
source worksheet (Sheet1) and destination worksheet (Test) to start on row 3.

Thanks so much for your help.



Sub movesheet()

With Sheets("Sheet1")
..Columns("B:B").Copy _
Destination:=Sheets("Test").Columns("C:C")
..Columns("C:C").Copy _
Destination:=Sheets("Test").Columns("G:G")
..Columns("F:F").Copy _
Destination:=Sheets("Test").Columns("F:F")
End With

End Sub
 
Reply With Quote
 
 
 
 
=?Utf-8?B?T3NzaWVNYWM=?=
Guest
Posts: n/a
 
      7th Oct 2007
Hi Joe,

The following copies everything from row 10 down. Hope my assumption is right.

You need a range to copy but the destination only needs to be the first cell.

Sub movesheet()

With Sheets("Sheet1")
Range(.Cells(10, "B"), Cells(.Rows.Count, "B")).Copy _
Destination:=Sheets("Test").Cells(3, "C")

Range(.Cells(10, "C"), Cells(.Rows.Count, "C")).Copy _
Destination:=Sheets("Test").Cells(3, "G")


Range(.Cells(10, "F"), Cells(.Rows.Count, "F")).Copy _
Destination:=Sheets("Test").Cells(3, "F")
End With

End Sub


Regards,

OssieMac


 
Reply With Quote
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      7th Oct 2007
Sub movesheet()
LR1 = SHeets("Sheet1").Cells(Rows.Count, 2).End(xlUP).Row
With Sheets("Sheet1")
..Range("B3:B" & LR1).Copy Sheets("Test").Columns("C10")
..Columns("C3:C" & LR1).Copy Sheets("Test").Columns("G10")
..Columns("F3:F" & LR1).Copy Sheets("Test").Columns("F10")
End With

End Sub

"Joe K." wrote:

>
> Please help me modify the movesheet macro listed below to start on row 10 on
> the
> source worksheet (Sheet1) and destination worksheet (Test) to start on row 3.
>
> Thanks so much for your help.
>
>
>
> Sub movesheet()
>
> With Sheets("Sheet1")
> .Columns("B:B").Copy _
> Destination:=Sheets("Test").Columns("C:C")
> .Columns("C:C").Copy _
> Destination:=Sheets("Test").Columns("G:G")
> .Columns("F:F").Copy _
> Destination:=Sheets("Test").Columns("F:F")
> End With
>
> End Sub

 
Reply With Quote
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      7th Oct 2007
sorry, I had the start rows reversed.

Sub movesheet()
LR1 = SHeets("Sheet1").Cells(Rows.Count, 2).End(xlUP).Row
With Sheets("Sheet1")
..Range("B10:B" & LR1).Copy Sheets("Test").Columns("C3")
..Columns("C10:C" & LR1).Copy Sheets("Test").Columns("G3")
..Columns("F10:F" & LR1).Copy Sheets("Test").Columns("F3")
End With

End Sub


"JLGWhiz" wrote:

> Sub movesheet()
> LR1 = SHeets("Sheet1").Cells(Rows.Count, 2).End(xlUP).Row
> With Sheets("Sheet1")
> .Range("B3:B" & LR1).Copy Sheets("Test").Columns("C10")
> .Columns("C3:C" & LR1).Copy Sheets("Test").Columns("G10")
> .Columns("F3:F" & LR1).Copy Sheets("Test").Columns("F10")
> End With
>
> End Sub
>
> "Joe K." wrote:
>
> >
> > Please help me modify the movesheet macro listed below to start on row 10 on
> > the
> > source worksheet (Sheet1) and destination worksheet (Test) to start on row 3.
> >
> > Thanks so much for your help.
> >
> >
> >
> > Sub movesheet()
> >
> > With Sheets("Sheet1")
> > .Columns("B:B").Copy _
> > Destination:=Sheets("Test").Columns("C:C")
> > .Columns("C:C").Copy _
> > Destination:=Sheets("Test").Columns("G:G")
> > .Columns("F:F").Copy _
> > Destination:=Sheets("Test").Columns("F:F")
> > End With
> >
> > End Sub

 
Reply With Quote
 
=?Utf-8?B?Sm9lIEsu?=
Guest
Posts: n/a
 
      7th Oct 2007
Can you help me modify the macro listed below so the range of cells is 90?
The rows go from 10 to 100.

Thanks so much.


"OssieMac" wrote:

> Hi Joe,
>
> The following copies everything from row 10 down. Hope my assumption is right.
>
> You need a range to copy but the destination only needs to be the first cell.
>
> Sub movesheet()
>
> With Sheets("Sheet1")
> Range(.Cells(10, "B"), Cells(.Rows.Count, "B")).Copy _
> Destination:=Sheets("Test").Cells(3, "C")
>
> Range(.Cells(10, "C"), Cells(.Rows.Count, "C")).Copy _
> Destination:=Sheets("Test").Cells(3, "G")
>
>
> Range(.Cells(10, "F"), Cells(.Rows.Count, "F")).Copy _
> Destination:=Sheets("Test").Cells(3, "F")
> End With
>
> End Sub
>
>
> Regards,
>
> OssieMac
>
>

 
Reply With Quote
 
Mike Fogleman
Guest
Posts: n/a
 
      7th Oct 2007
Rows 10 - 100 copied:

Sub movesheet()

With Sheets("Sheet1")
..Range("B10:B100").Copy Sheets("Test").Range("C3")
..Range("C10:C100").Copy Sheets("Test").Range("G3")
..Range("F10:F100").Copy Sheets("Test").Range("F3")
End With

End Sub

Mike F
"Joe K." <Joe K.@discussions.microsoft.com> wrote in message
news:92A8A7B0-57F8-4E38-804F-(E-Mail Removed)...
> Can you help me modify the macro listed below so the range of cells is 90?
> The rows go from 10 to 100.
>
> Thanks so much.
>
>
> "OssieMac" wrote:
>
>> Hi Joe,
>>
>> The following copies everything from row 10 down. Hope my assumption is
>> right.
>>
>> You need a range to copy but the destination only needs to be the first
>> cell.
>>
>> Sub movesheet()
>>
>> With Sheets("Sheet1")
>> Range(.Cells(10, "B"), Cells(.Rows.Count, "B")).Copy _
>> Destination:=Sheets("Test").Cells(3, "C")
>>
>> Range(.Cells(10, "C"), Cells(.Rows.Count, "C")).Copy _
>> Destination:=Sheets("Test").Cells(3, "G")
>>
>>
>> Range(.Cells(10, "F"), Cells(.Rows.Count, "F")).Copy _
>> Destination:=Sheets("Test").Cells(3, "F")
>> End With
>>
>> End Sub
>>
>>
>> Regards,
>>
>> OssieMac
>>
>>



 
Reply With Quote
 
=?Utf-8?B?T3NzaWVNYWM=?=
Guest
Posts: n/a
 
      7th Oct 2007
Hi Joe,

There is nothing wrong with Mike's code. However, just for your information
the following is my code modified:-

Sub movesheet()

With Sheets("Sheet1")
Range(.Cells(10, "B"), .Cells(100, "B")).Copy _
Destination:=Sheets("Test").Cells(3, "C")

Range(.Cells(10, "C"), .Cells(100, "C")).Copy _
Destination:=Sheets("Test").Cells(3, "G")

Range(.Cells(10, "F"), .Cells(100, "F")).Copy _
Destination:=Sheets("Test").Cells(3, "F")
End With

End Sub


Regards,

OssieMac

"Mike Fogleman" wrote:

> Rows 10 - 100 copied:
>
> Sub movesheet()
>
> With Sheets("Sheet1")
> ..Range("B10:B100").Copy Sheets("Test").Range("C3")
> ..Range("C10:C100").Copy Sheets("Test").Range("G3")
> ..Range("F10:F100").Copy Sheets("Test").Range("F3")
> End With
>
> End Sub
>
> Mike F
> "Joe K." <Joe K.@discussions.microsoft.com> wrote in message
> news:92A8A7B0-57F8-4E38-804F-(E-Mail Removed)...
> > Can you help me modify the macro listed below so the range of cells is 90?
> > The rows go from 10 to 100.
> >
> > Thanks so much.
> >
> >
> > "OssieMac" wrote:
> >
> >> Hi Joe,
> >>
> >> The following copies everything from row 10 down. Hope my assumption is
> >> right.
> >>
> >> You need a range to copy but the destination only needs to be the first
> >> cell.
> >>
> >> Sub movesheet()
> >>
> >> With Sheets("Sheet1")
> >> Range(.Cells(10, "B"), Cells(.Rows.Count, "B")).Copy _
> >> Destination:=Sheets("Test").Cells(3, "C")
> >>
> >> Range(.Cells(10, "C"), Cells(.Rows.Count, "C")).Copy _
> >> Destination:=Sheets("Test").Cells(3, "G")
> >>
> >>
> >> Range(.Cells(10, "F"), Cells(.Rows.Count, "F")).Copy _
> >> Destination:=Sheets("Test").Cells(3, "F")
> >> End With
> >>
> >> End Sub
> >>
> >>
> >> Regards,
> >>
> >> OssieMac
> >>
> >>

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy cell value from one worksheet to matching worksheet in another workbook rech Microsoft Excel Programming 4 29th Sep 2011 03:02 PM
Copy Values From Worksheet to another Worksheet same Workbook =?Utf-8?B?Sm9lIEsu?= Microsoft Excel Programming 1 6th Oct 2007 08:45 PM
Copy Excel Worksheet to new Workbook via VBA without Links to original Workbook JamesDMB Microsoft Access Form Coding 0 21st Mar 2007 06:13 PM
Copy Values from WorkSheet back to Another Workbook Replacing Values in Worksheet bobwilson Microsoft Excel Programming 0 3rd Apr 2006 09:50 PM
Copy from different workbook's worksheet into a single worksheet... johnprasun@gmail.com Microsoft Excel Misc 1 27th Oct 2005 07:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:48 PM.