Hello,
I work with 2 sheets.
1 is my MasterTemp, in this file I enter data that I save with a VBA to the other sheet called Overview.
It also automatically gives me the number of the next row so I can save my data under certain codes.
Overview is my storage database. where I can get all my data and filter it to what I need.
But now I am trying to create a button so I can recall data from Overview back to the Mastertemp by entering the code that was preset in row A of Overview and will recall everything in that row back to the MasterTemp.
No matter what I do.. it will not call the data back. I can do it by asking cells to transport, but it won't be linked to the specific code in a cell which I need the entire row of data from.
So in this case I don't know where to start to get it linked.
Can you help me?
This is my complete workbook
Sub AddToOverview()
Dim wsOverview As Worksheet, emptyRowOverview As Long
Set wsOverview = Worksheets("Overview")
emptyRowOverview = wsOverview.Cells(Rows.Count, "B").End(xlUp).Row + 1
wsOverview.Cells(emptyRowOverview, "A") = Me.Range("E7")
wsOverview.Cells(emptyRowOverview, "B") = Me.Range("E8")
wsOverview.Cells(emptyRowOverview, "C") = Me.Range("E9")
wsOverview.Cells(emptyRowOverview, "D") = Me.Range("E10")
wsOverview.Cells(emptyRowOverview, "E") = Me.Range("E11")
wsOverview.Cells(emptyRowOverview, "F") = Me.Range("E12")
wsOverview.Cells(emptyRowOverview, "G") = Me.Range("E13")
wsOverview.Cells(emptyRowOverview, "H") = Me.Range("E14")
wsOverview.Cells(emptyRowOverview, "I") = Me.Range("E15")
wsOverview.Cells(emptyRowOverview, "J") = Me.Range("E17")
wsOverview.Cells(emptyRowOverview, "K") = Me.Range("E19")
wsOverview.Cells(emptyRowOverview, "L") = Me.Range("E24")
wsOverview.Cells(emptyRowOverview, "M") = Me.Range("E25")
wsOverview.Cells(emptyRowOverview, "N") = Me.Range("E26")
wsOverview.Cells(emptyRowOverview, "O") = Me.Range("E28")
wsOverview.Cells(emptyRowOverview, "P") = Me.Range("E31")
EmptyInputFields
MsgBox "NCR data transported"
End Sub
Sub EmptyInputFields()
Me.Range("E7").ClearContents
Me.Range("E8").ClearContents
Me.Range("E9").ClearContents
Me.Range("E10").ClearContents
Me.Range("E11").ClearContents
Me.Range("E12").ClearContents
Me.Range("E13").ClearContents
Me.Range("E14").ClearContents
Me.Range("E15").ClearContents
Me.Range("E17").ClearContents
Me.Range("E19").ClearContents
Me.Range("E24").ClearContents
Me.Range("E25").ClearContents
Me.Range("E26").ClearContents
Me.Range("E28").ClearContents
Me.Range("E31").ClearContents
End Sub
Sub GetNextNumber()
Dim wsOverview As Worksheet, emptyRowOverview As Long
Set wsOverview = Worksheets("Overview")
emptyRowOverview = wsOverview.Cells(Rows.Count, "B").End(xlUp).Row + 1
Me.Cells(7, "E") = wsOverview.Cells(emptyRowOverview, "A")
End Sub
Private Sub CommandButton1_Click()
Range("E9").Value = Now()
End Sub
Private Sub CommandButton2_Click()
Dim invoiceRng As Range
Dim strfile As String
'Setting range to be printed
Set invoiceRng = Range("C1:F93")
'setting file name with a time stamp.
strfile = "NCR" & "_" & Format(Now(), "yyyymmdd_hhmmss") & ".pdf"
strfile = ThisWorkbook.Path & strfile
invoiceRng.ExportAsFixedFormat _
Type:=xlTypePDF, _
Filename:=strfile, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=True, _
OpenAfterPublish:=True
End Sub
Private Sub CommandButton3_Click()
Dim wsOverview As ActiveSheet
ActiveSheet.Range("A" & ActiveSheet.Buttons(Application.Caller).TopLeftCell.Row).Select
End Sub
This last part is what I am struggling with
Bookmarks