Solved

Transfer info to another sheet

Posted on 2014-07-28
2
118 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 50

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
using fill in Excel 6 29
Excel if formula 2 19
Excel change font color in formula 19 28
extract a substring between backslashes from paths 10 17
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Do you use a spreadsheet like Microsoft's Excel?  Have you ever wanted to link out to a non excel file on your computer or network drive?  This is the way I found to do it!
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

790 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