Solved

Transfer info to another sheet

Posted on 2014-07-28
2
119 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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
Excel 2010 Vlookup 4 27
Excel 2016 lost MRU list 8 69
Tricky Shapes formula part 4 4 14
Excel - Open a UserForm from a Custom Ribbon button with ribbonxml 5 15
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
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…

733 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