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

I'm creating an excel template for a company. On the first sheet I need a list of items and their descriptions, and I need to have a way to select only certain items and then move those entire rows of the items and their descriptions to sheet 2. Do you have any ideas on how I could go about doing this? I'm really stuck!!!!!!!!!!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default move row from one sheet to another

Something like this :-

'---------------------------------------------------------
Sub transfer_data()
Dim FromSheet As Worksheet
Dim ToSheet As Worksheet
Dim FromRow As Long
Dim ToRow As Long
Dim LastRow As Long
Dim FindValue
'--------------------------
Application.Calculation = xlCalculationManual
Set FromSheet = ActiveSheet
Set ToSheet = Workbooks("Book1.xls").Worksheets("data")
LastRow = ToSheet.Range("A65536").End(xlUp).Row + 1
FromRow = 2
While FromSheet.Cells(FromRow, 1).Value < ""
FindValue = FromSheet.Cells(FromRow, 1).Value
'- check for transfer or not
If FindValue 10 Then
FromSheet.Range("A" & FromRow & ":H" & FromRow).Copy
ToSheet.Paste Destination:=ToSheet.Range("A" & LastRow)
LastRow = LastRow + 1
'- delete row
FromSheet.Rows(FromRow).EntireRow.Delete
Else
FromRow = FromRow + 1
End If
Wend
Application.Calculation = xlCalculationAutomatic
MsgBox ("Done")
End Sub
'---------------------------------------------------------------

--
Message posted from http://www.ExcelForum.com

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
How to move rows from one sheet to another sheet (macro) Stacey Excel Discussion (Misc queries) 1 December 30th 09 02:52 PM
Creating form on sheet 1 and having info move to sheet 2 SHARON Excel Discussion (Misc queries) 4 June 1st 09 05:01 PM
How do I move daily data from one sheet to a 'yearly sheet' ClintH2007 Excel Worksheet Functions 3 September 10th 07 07:02 AM
Move data to new sheet - rename sheet based on criteria ? [email protected] Excel Discussion (Misc queries) 7 May 16th 07 10:22 PM
move rows of data seperated in a sheet to a sheet with no separat Lynn Excel Worksheet Functions 5 December 22nd 06 03:18 AM


All times are GMT +1. The time now is 03:26 AM.

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

About Us

"It's about Microsoft Excel"