Results 1 to 3 of 3

How to fetch specific data from other sheet using macro?

Threaded View

  1. #1
    Forum Contributor
    Join Date
    01-01-2022
    Location
    India
    MS-Off Ver
    Home 2021
    Posts
    779

    How to fetch specific data from other sheet using macro?

    Hi all,

    Hope all are well.

    1 help please


    In Serialisation PR Records file, in sheet DM Records, Column C will contain same number as in Column B in Serialisation - DM Report 2023 file. Based on this common data in the columns, column O, U and V in Serialisation PR Records file shall be fetched from Serialisation - DM Report 2023 file.


    Note 1:

    Both the files will have same file names and will be open while running macro.

    Macro is required in Serialisation PR Records file


    Where in Serialisation PR Records file,

    Number under Column C is available under Column B in Serialisation - DM Report 2023 file with below conditions:

    Column G = TSCO REQ

    Column I = Complete Notification & Inform Requestor

    Then,

    1. Column U in Serialisation PR Records file shall show as "Completed", else "Pending"


    2. Column O in Serialisation PR Records file shall be fetched from Column K in Serialisation - DM Report 2023 file


    3. Column V in Serialisation PR Records file shall be fetched combined from Column N and O in Serialisation - DM Report 2023 file and populated in the below format (FYI: columns N and O in actual will be hidden)

    23-01-2023 10:38:07 AM


    Note2:

    Column V in Serialisation PR Records file shall might give a problem since it automatically captures timestamp based on below macro. This auto timestamp is required only when data is selected in Column N thus capturing timestamp its in column Q while all other columns are to be removed from below macro.

    Private Sub Worksheet_Change(ByVal Target As Range)
        If Target.Row < 3 Then Exit Sub
        If Target.CountLarge > 1 Then Exit Sub
        Application.EnableEvents = False
        Me.Unprotect
        If Not Intersect(Target, Range("n:n,u:u,aa:aa")) Is Nothing Then
            If Target.Column < 18 Then
                With Target(, 4)
                    .ClearContents
                    .NumberFormat = "dd/mmm/yyyy  hh:mm AM/PM"
                    If Target.Value <> "" Then .Value = Now
                End With
            Else
                Select Case Target
                    Case "Completed", "Closed"
                        With Target(, 2)
                            .NumberFormat = "dd/mmm/yyyy  hh:mm AM/PM"
                            .Value = Now
                        End With
                    Case Else
                        Target(, 2).ClearContents
                End Select
            End If
        End If
        Application.EnableEvents = True
        Me.Protect
    End Sub

    Note3:

    Sheet PR Records contains CF and sheet DM PR Availability contains formulae with respect to sheet DM Records. Hope they run perfectly, else i will be doomed


    Pass: Abc@123


    Can someone please help
    Last edited by rizwanulhasan; 03-31-2023 at 11:40 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Help on macro to fetch data from one sheet and post on the other
    By preond in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-21-2016, 09:15 AM
  2. Macro to fetch data from one sheet to another
    By Nirmall in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-18-2015, 04:55 AM
  3. macro to loop through data sheet , fetch 8 rows at a time and put in new sheet
    By nyree in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-04-2015, 01:46 AM
  4. Replies: 7
    Last Post: 04-01-2015, 05:40 PM
  5. Need a macro to fetch data from different sheets and club into one sheet.
    By sam190 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-16-2013, 03:27 AM
  6. macro to fetch specific column data from other sheets to a mainsheet
    By PhAnT0M in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-19-2012, 01:33 PM

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