Solved

Transfer info to another sheet

Posted on 2014-07-28
2
115 Views
Last Modified: 2014-07-28
Hi,

I have a ss where i want rows A23:G23 to be transferred to tab "transfer"

I need the data to append, so first append into A2, then any further appends, a3, a4

So the user will press the button "Add", the code transfers "A23:G23"  to "A2:G2" in sheet "transfer"

If they press add again, it transfers to A3:G3

If the user hits add twice, but the none of the data in A23:G23 changes, then the user gets a msg box "This is the same data, are you sure you want to send", if Yes, Send, if no, exit sub

Many thanks!
0
Comment
Question by:Seamus2626
2 Comments
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 40224550
Hi,

pls try

Sub macro()
Dim arrData As Variant
Dim arrTransfer As Variant
LastTransferRow = Sheets("transfer").Range("A" & Rows.Count).End(xlUp).Row
arrData = Join(WorksheetFunction.Index(Sheets("data").Range("A23:G23").Value, 1, 0), ";")
arrTransfer = Join(WorksheetFunction.Index(Sheets("transfer").Range("A" & LastTransferRow & ":G" & LastTransferRow).Value, 1, 0), ";")
If arrData = arrTransfer Then
    Res = MsgBox("This is the same data, are you sure you want to send", vbYesNo)
    If Res = vbYes Then
        Sheets("data").Range("A23:G23").Copy Sheets("transfer").Range("A" & LastTransferRow + 1)
    Else
        Exit Sub
    End If
Else
    Sheets("data").Range("A23:G23").Copy Sheets("transfer").Range("A" & LastTransferRow + 1)
End If
End Sub

Open in new window

Regards
0
 

Author Closing Comment

by:Seamus2626
ID: 40224638
Legend!!

Thanks!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Compile Error 7 41
increment numbers by 10 11 30
excel help 4 20
Excel - Duplicate values in columns 4 0
Improved? Move/Copy Add-in Replacement - How to avoid the annoying, “A formula or sheet you want to move or copy contains the name XXX, which already exists on the destination worksheet.” David Miller (dlmille)  It was one of those days… I wa…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now