saving fcell contents in a separate list

  • Thread starter Thread starter jeremy
  • Start date Start date
J

jeremy

Can anyone help.

I have a spreadsheet containing information on one
customer in several cells. this spreadsheet is used for
each new customer contact. I would like to save the info
in this documnet in a separate spreadsheet with all the
cell information in one row as shown below.

Document 1

Customer: Cust 1

info 1 info 3

Info 2 info 4


Document 2


Cust 1 info1 info 2 info 3 info 4
Cust 2 info1 info 2 info 3 info 4
Cust 3 info1 info 2 info 3 info 4
Cust 4 info1 info 2 info 3 info 4

What I need is a progamming device on the first document
which will save the cell info into the second document in
the next availalbe row.
 
with worksheets("Sheet2")
set rng = .Cells(rows.count,1).End(xlup)(2)
End With

rng.Value = cust
rng.offset(0,1).Value = info1
rng.offset(0,2).Value = info2
rng.offset(0,3).Value = info3
rng.offset(0,4).Value = info4


change info1 to info4 with the actual cell references such as
worksheets("Sheet1").Range("B9")
 
Thanks Tom,
I managed to arrange that to suit nicely. i now have a
command button that saves thecustomer info in a list in
sheet 2.Could you perhaps advise me as well how to avoid
saving duplicates of the customer details in the list???
 
Dim res as Variant
Dim rng as Range
Dim rng1 as Range
with worksheets("Sheet2")
set rng = .Cells(rows.count,1).End(xlup)(2)
set rng1 = .Range(.Cells(1,1),rng)
End With

res = Application.Match(cust,rng1,0)
if iserror(res) then
rng.Value = cust
rng.offset(0,1).Value = info1
rng.offset(0,2).Value = info2
rng.offset(0,3).Value = info3
rng.offset(0,4).Value = info4
End if
 

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