Solved

Transfer info to another sheet

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

786 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