saving fcell contents in a separate 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
--
Regards,
Tom Ogilvy
"jeremy" wrote in message
...
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???
-----Original Message-----
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")
--
Regards,
Tom Ogilvy
"jeremy" wrote in
message
...
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.
.
|