Help with worksheet code

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

This is almost what I need but can anyone help please. I need for it to COPY
"Sent to Assembly" sheet each time something is added(Columns A, B, C and
sent to Sheet1. Right now it only copies Column A. Also should this go in a
Module or a worksheet function? Thanks in advance
 
What you say sounds like you intended to include your code, but there was no
code in your post.
You say to copy Columns A:C when something is added. Added where? Do you
mean that when something is added in some row that you want that row,
Columns A:C, copied? Do you want this to happen when anything is added to
any of the 3 columns?
Where in Sheet1 do you want the copy placed? And this would have to be VBA
(module). HTH Otto
 
Sorry forgot to post

Sub CopyDups()
Dim rColAOne As Range
Dim rColATwo As Range
Dim Dest As Range
Dim i As Range
Sheets("Sent to Assembly").Select
Set rColAOne = Range("A3", Range("A" & Rows.Count).End(xlUp))
With Sheets("Sheet1")
Set rColATwo = .Range("A3", .Range("A" & Rows.Count).End(xlUp))
End With
Set Dest = Sheets("Sheet1").Range("A3")
For Each i In rColAOne


i.Copy Dest
Set Dest = Dest.Offset(1)

Next i
End Sub
 
I think you originally wrote this
Sub CopyDups()
Dim rColAOne As Range
Dim rColATwo As Range
Dim Dest As Range
Dim i As Range
Sheets("Sent to Assembly").Select
Set rColAOne = Range("A3", Range("A" & Rows.Count).End(xlUp))
With Sheets("Sheet1")
Set rColATwo = .Range("A3", .Range("A" & Rows.Count).End(xlUp))
End With
Set Dest = Sheets("Sheet1").Range("A3")
For Each i In rColAOne


i.Copy Dest
Set Dest = Dest.Offset(1)

Next i
End Sub
 
Still not quite sure what you want but put this in a sheet module and modify
to suit.
As written, if you fill out b,c, & d and then enter something in col a the
row will be copied to sheet 1 next available row.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 1 Then Exit Sub
With Sheets("sheet1")
lr = .Cells(Rows.Count, "a").End(xlUp).Row + 1
Target.Resize(1, 4).Copy .Cells(lr, 1)
End With
End Sub
 
Richard
Read the questions I asked in my earlier post in this same thread and
provide your answers. What you want is easy to do if I know what you want.
HTH Otto
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top