M
milt2005
Hello.
I use a vba code that make excel to copy, in automatic way, a row from
a sheet to another, inclused the images (if there are), when I put a
number in the first cell of the row.
I use this for select some product from a catalog to make an order, and
it work well.
Now I try to select the cells (the first of the rows) through the
"Form" (from Data> Form...). The form select the cell but the vba code
dont work and excel dont copy the rows that I select to the next sheet.
Know somebody how can I do to make it?
Thanks.
_____________________________________________________________
This is the code that I use:
*Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Long, x As String, y As Range, cell As Range
If Target.Column <> 2 Then Exit Sub
If Target.Cells.Count > 1 Then Exit Sub
i = Target.Row
Application.ScreenUpdating = False
If Target <> "" Then
If Sheets("customer copy").Cells(1, 1) = "" Then
Cells(i, 1).EntireRow.Copy Sheets("customer copy").Cells(1, 1)
Else: Cells(i, 1).EntireRow.Copy Sheets("customer copy").Cells(65536,
1).End(xlUp)(2, 1)
End If
End If
If Target = "" Then
x = Sheets("choice copy").Cells(i, 1).Value
Sheets("customer copy").Select
For Each c In
ActiveSheet.Columns("A:A").SpecialCells(xlCellTypeConstants, 3)
If c.Value = x Then
c.EntireRow.Delete
End If
Next
Sheets("choice copy").Select
End If
Application.ScreenUpdating = True
End Sub*
I use a vba code that make excel to copy, in automatic way, a row from
a sheet to another, inclused the images (if there are), when I put a
number in the first cell of the row.
I use this for select some product from a catalog to make an order, and
it work well.
Now I try to select the cells (the first of the rows) through the
"Form" (from Data> Form...). The form select the cell but the vba code
dont work and excel dont copy the rows that I select to the next sheet.
Know somebody how can I do to make it?
Thanks.
_____________________________________________________________
This is the code that I use:
*Private Sub Worksheet_Change(ByVal Target As Range)
Dim i As Long, x As String, y As Range, cell As Range
If Target.Column <> 2 Then Exit Sub
If Target.Cells.Count > 1 Then Exit Sub
i = Target.Row
Application.ScreenUpdating = False
If Target <> "" Then
If Sheets("customer copy").Cells(1, 1) = "" Then
Cells(i, 1).EntireRow.Copy Sheets("customer copy").Cells(1, 1)
Else: Cells(i, 1).EntireRow.Copy Sheets("customer copy").Cells(65536,
1).End(xlUp)(2, 1)
End If
End If
If Target = "" Then
x = Sheets("choice copy").Cells(i, 1).Value
Sheets("customer copy").Select
For Each c In
ActiveSheet.Columns("A:A").SpecialCells(xlCellTypeConstants, 3)
If c.Value = x Then
c.EntireRow.Delete
End If
Next
Sheets("choice copy").Select
End If
Application.ScreenUpdating = True
End Sub*