+ Reply to Thread
Results 1 to 3 of 3

recall data by entering code of a cell in another sheet

  1. #1
    Registered User
    Join Date
    03-31-2021
    Location
    netherlands
    MS-Off Ver
    2020
    Posts
    4

    recall data by entering code of a cell in another sheet

    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
    Last edited by TBV; 04-22-2021 at 07:08 AM.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,413

    Re: recall data by entering code of a cell in another sheet

    Welcome to the forum

    Please attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    03-31-2021
    Location
    netherlands
    MS-Off Ver
    2020
    Posts
    4

    Re: recall data by entering code of a cell in another sheet

    workbook added!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 6
    Last Post: 05-06-2016, 12:10 AM
  2. Replies: 2
    Last Post: 05-03-2015, 06:02 AM
  3. [SOLVED] VBA Code entering Data in wrong cell
    By drsadistic in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 08-07-2014, 03:09 PM
  4. Recall cell data saved in Name Manager/ Need a Pull-down menu with time
    By deiopei in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 06-05-2014, 01:05 PM
  5. Replies: 5
    Last Post: 02-09-2014, 11:04 PM
  6. [SOLVED] Recall relative cell by dropdown list on separate sheet
    By BrianATrease in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-26-2012, 06:49 PM
  7. Run a sheet's activate code when entering it's workbook
    By mikeburg in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-03-2005, 01:55 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1