Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving records from a sheet to another


Hi everbody,

This is my first question in this great forum and I hope I find the
satisfactory answer for it,

I have this code witch works on moving one record only form a sheet to
another, I want to edit it to be able to move more than one record at
the same time.


Code:
--------------------
Sub FillSalesList()
With Sheets("2").Columns(1).Rows(65536).End(xlUp)
.Offset(1, 0) = Sheet1.[a2]
.Offset(1, 1) = Sheet1.[b2]
.Offset(1, 2) = Sheet1.[c2]
.Offset(1, 3) = Sheet1.[d2]
.Offset(1, 4) = Sheet1.[e2]
.Offset(1, 5) = Sheet1.[f2]
.Offset(1, 6) = Sheet1.[g2]
End With
[a2] = [a2] + 1
[b2:g2].ClearContents
End Sub
--------------------

I hope that my question is clear for all and I find the answer for it.


--
LoveCandle
------------------------------------------------------------------------
LoveCandle's Profile: http://www.excelforum.com/member.php...o&userid=28612
View this thread: http://www.excelforum.com/showthread...hreadid=482711

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Moving records from a sheet to another

Hi LoveCandle,

Try:

'================
Public Sub FillSalesList()
Dim srcRng As Range
Dim destRng As Range
Dim vVal As Long

Dim Lrow As Long

Lrow = Cells(Rows.Count, "A").End(xlUp).Row

Set srcRng = ActiveSheet.Range("A2:G" & Lrow)
Set destRng = Sheets("2"). _
Cells(Rows.Count, "A").End(xlUp)(2)

srcRng.Copy Destination:=destRng

vVal = Range("A" & Lrow).Value + 1

srcRng.ClearContents
srcRng(1) = vVal

End Sub
'<<================

---
Regards,
Norman



"LoveCandle" wrote
in message ...

Hi everbody,

This is my first question in this great forum and I hope I find the
satisfactory answer for it,

I have this code witch works on moving one record only form a sheet to
another, I want to edit it to be able to move more than one record at
the same time.


Code:
--------------------
Sub FillSalesList()
With Sheets("2").Columns(1).Rows(65536).End(xlUp)
.Offset(1, 0) = Sheet1.[a2]
.Offset(1, 1) = Sheet1.[b2]
.Offset(1, 2) = Sheet1.[c2]
.Offset(1, 3) = Sheet1.[d2]
.Offset(1, 4) = Sheet1.[e2]
.Offset(1, 5) = Sheet1.[f2]
.Offset(1, 6) = Sheet1.[g2]
End With
[a2] = [a2] + 1
[b2:g2].ClearContents
End Sub
--------------------

I hope that my question is clear for all and I find the answer for it.


--
LoveCandle
------------------------------------------------------------------------
LoveCandle's Profile:
http://www.excelforum.com/member.php...o&userid=28612
View this thread: http://www.excelforum.com/showthread...hreadid=482711



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Moving records from a sheet to another


Thank you soooooooo much Norman That is really what I am looking for.


--
LoveCandle
------------------------------------------------------------------------
LoveCandle's Profile: http://www.excelforum.com/member.php...o&userid=28612
View this thread: http://www.excelforum.com/showthread...hreadid=482711

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
formula for moving information from one sheet to another sheet Puzzled Excel Discussion (Misc queries) 4 June 6th 10 05:58 AM
moving informatiion from one sheet to a total sheet john Excel Discussion (Misc queries) 2 January 31st 08 10:17 PM
Automatically add records from a new sheet to master sheet [email protected] Excel Discussion (Misc queries) 1 January 2nd 07 08:24 PM
moving records from one sheet to other knight New Users to Excel 1 June 30th 06 02:26 AM
Copying records to another sheet kapiliary Excel Discussion (Misc queries) 5 April 18th 06 09:29 PM


All times are GMT +1. The time now is 07:54 AM.

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

About Us

"It's about Microsoft Excel"