Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
CP CP is offline
external usenet poster
 
Posts: 64
Default Wanting to move single lines to second worksheet

I have grabbed a file where by entering an X in lets say line G7 on sheet 1,
it transfers all of line 7 (A through to F) onto the next available row on
sheet 2. It doesnt explain how it is done though - any starting point for me?

I would like to use it for building a list from a large selection of records
- like a customers order for instance.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,355
Default Wanting to move single lines to second worksheet

PRess ALT F11 to view the code. Look in each module. Come back here if
you have questions.

"CP" wrote:

I have grabbed a file where by entering an X in lets say line G7 on sheet 1,
it transfers all of line 7 (A through to F) onto the next available row on
sheet 2. It doesnt explain how it is done though - any starting point for me?

I would like to use it for building a list from a large selection of records
- like a customers order for instance.

  #3   Report Post  
Posted to microsoft.public.excel.misc
CP CP is offline
external usenet poster
 
Posts: 64
Default Wanting to move single lines to second worksheet

Ok found alot of coding - but doesnt make any sense

Sub MoveRow()
Dim wsOrder As Worksheet
Dim wsData As Worksheet
Dim r As Long

Set wsOrder = Worksheets("OrderForm")
Set wsData = Worksheets("Data Entry")
r = wsOrder.Cells(Rows.Count, 1).End(xlUp).Row + 1

ActiveCell.EntireRow.Copy Destination:=wsOrder.Cells(r, 1)

End Sub

----

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 3 And Target.Column = 3 Then
'calculate criteria cell in case calculation mode is manual
Worksheets("ProductsList").Range("I3").Calculate
Worksheets("ProductsList").Range("Database") _
.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("ProductsList").Range("I2:I3 "), _
CopyToRange:=Range("A6:G6"), Unique:=False
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 7 And Target.Row 6 Then
If Cells(Target.Row, 1).Value < "" Then
Target.Value = "X"
MoveRow
'MsgBox "Row has been copied"
End If
End If
End Sub
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Wanting to move single lines to second worksheet

If, after reading and re-reading, it still doesn't make "any" sense, you
probably will need professional help.
the "moverow" macro is not moving the data but is copying the entire row
(not just some columns) to the next available cell in col A of the
destination sheet. It may be fired manually or as shown by selecting a cell
in column 7 below row 6.

--
Don Guillett
SalesAid Software

"CP" wrote in message
...
Ok found alot of coding - but doesnt make any sense

Sub MoveRow()
Dim wsOrder As Worksheet
Dim wsData As Worksheet
Dim r As Long

Set wsOrder = Worksheets("OrderForm")
Set wsData = Worksheets("Data Entry")
r = wsOrder.Cells(Rows.Count, 1).End(xlUp).Row + 1

ActiveCell.EntireRow.Copy Destination:=wsOrder.Cells(r, 1)

End Sub

----

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 3 And Target.Column = 3 Then
'calculate criteria cell in case calculation mode is manual
Worksheets("ProductsList").Range("I3").Calculate
Worksheets("ProductsList").Range("Database") _
.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("ProductsList").Range("I2:I3 "), _
CopyToRange:=Range("A6:G6"), Unique:=False
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 7 And Target.Row 6 Then
If Cells(Target.Row, 1).Value < "" Then
Target.Value = "X"
MoveRow
'MsgBox "Row has been copied"
End If
End If
End Sub


  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 21
Default Wanting to move single lines to second worksheet

CP--- I Can't help you, but maybe you can help me. I want to move the quote
number & name( 2 cells) on my "Quotes" Tab, to the Job number & Name Slots on
my "Jobs" Tab.I have been able to move the data from one sheet to the next,
however don't know how to make the quotes appear in the next available Job #
column. Any insight??
DC
-


"CP" wrote:

Ok found alot of coding - but doesnt make any sense

Sub MoveRow()
Dim wsOrder As Worksheet
Dim wsData As Worksheet
Dim r As Long

Set wsOrder = Worksheets("OrderForm")
Set wsData = Worksheets("Data Entry")
r = wsOrder.Cells(Rows.Count, 1).End(xlUp).Row + 1

ActiveCell.EntireRow.Copy Destination:=wsOrder.Cells(r, 1)

End Sub

----

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 3 And Target.Column = 3 Then
'calculate criteria cell in case calculation mode is manual
Worksheets("ProductsList").Range("I3").Calculate
Worksheets("ProductsList").Range("Database") _
.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("ProductsList").Range("I2:I3 "), _
CopyToRange:=Range("A6:G6"), Unique:=False
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 7 And Target.Row 6 Then
If Cells(Target.Row, 1).Value < "" Then
Target.Value = "X"
MoveRow
'MsgBox "Row has been copied"
End If
End If
End Sub



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Wanting to move single lines to second worksheet

You are doing what is called "Hijacking". Start your OWN thread with a
suitable subject line and before/after examples of what you want.

--
Don Guillett
SalesAid Software

"Muddled" wrote in message
...
CP--- I Can't help you, but maybe you can help me. I want to move the
quote
number & name( 2 cells) on my "Quotes" Tab, to the Job number & Name Slots
on
my "Jobs" Tab.I have been able to move the data from one sheet to the
next,
however don't know how to make the quotes appear in the next available Job
#
column. Any insight??
DC
-


"CP" wrote:

Ok found alot of coding - but doesnt make any sense

Sub MoveRow()
Dim wsOrder As Worksheet
Dim wsData As Worksheet
Dim r As Long

Set wsOrder = Worksheets("OrderForm")
Set wsData = Worksheets("Data Entry")
r = wsOrder.Cells(Rows.Count, 1).End(xlUp).Row + 1

ActiveCell.EntireRow.Copy Destination:=wsOrder.Cells(r, 1)

End Sub

----

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 3 And Target.Column = 3 Then
'calculate criteria cell in case calculation mode is manual
Worksheets("ProductsList").Range("I3").Calculate
Worksheets("ProductsList").Range("Database") _
.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("ProductsList").Range("I2:I3 "), _
CopyToRange:=Range("A6:G6"), Unique:=False
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 7 And Target.Row 6 Then
If Cells(Target.Row, 1).Value < "" Then
Target.Value = "X"
MoveRow
'MsgBox "Row has been copied"
End If
End If
End Sub


  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 21
Default Wanting to move single lines to second worksheet

Sorry,
OK
DG

"Don Guillett" wrote:

You are doing what is called "Hijacking". Start your OWN thread with a
suitable subject line and before/after examples of what you want.

--
Don Guillett
SalesAid Software

"Muddled" wrote in message
...
CP--- I Can't help you, but maybe you can help me. I want to move the
quote
number & name( 2 cells) on my "Quotes" Tab, to the Job number & Name Slots
on
my "Jobs" Tab.I have been able to move the data from one sheet to the
next,
however don't know how to make the quotes appear in the next available Job
#
column. Any insight??
DC
-


"CP" wrote:

Ok found alot of coding - but doesnt make any sense

Sub MoveRow()
Dim wsOrder As Worksheet
Dim wsData As Worksheet
Dim r As Long

Set wsOrder = Worksheets("OrderForm")
Set wsData = Worksheets("Data Entry")
r = wsOrder.Cells(Rows.Count, 1).End(xlUp).Row + 1

ActiveCell.EntireRow.Copy Destination:=wsOrder.Cells(r, 1)

End Sub

----

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 3 And Target.Column = 3 Then
'calculate criteria cell in case calculation mode is manual
Worksheets("ProductsList").Range("I3").Calculate
Worksheets("ProductsList").Range("Database") _
.AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheets("ProductsList").Range("I2:I3 "), _
CopyToRange:=Range("A6:G6"), Unique:=False
End If
End Sub

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Column = 7 And Target.Row 6 Then
If Cells(Target.Row, 1).Value < "" Then
Target.Value = "X"
MoveRow
'MsgBox "Row has been copied"
End If
End If
End Sub



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
merging single worksheet files into a single workbook DDK Excel Discussion (Misc queries) 1 December 5th 06 05:25 PM
How to paste the 4 lines in a single row in excel? lalitha Excel Discussion (Misc queries) 1 July 27th 06 06:06 AM
Save a single worksheet in Excel as a single file. Dakota New Users to Excel 4 February 22nd 06 04:46 PM
two lines of text in a single row? SteveB Excel Discussion (Misc queries) 18 June 30th 05 05:09 PM
two lines of text in single row SteveB Excel Discussion (Misc queries) 2 May 17th 05 08:17 PM


All times are GMT +1. The time now is 10:09 PM.

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"