Results 1 to 1 of 1

How to access the data from column of one sheet and then create a connection for logic

Threaded View

Ohanzee How to access the data from... 10-02-2021, 01:39 PM
  1. #1
    Registered User
    Join Date
    10-02-2021
    Location
    Karachi
    MS-Off Ver
    2019
    Posts
    1

    How to access the data from column of one sheet and then create a connection for logic

    This code is to mark attendance from the zoom master excel file.
    Sub KeepOnlyAtSymbolRows()
        Dim ws As Worksheet
        Dim rng As Range
        Dim lastRow As Long
    
        Set ws = ActiveWorkbook.Sheets("Sheet1")
        Range("W2").Value = "CWRT"
        Range("W3").Value = "MTH"
        Range("W4").Value = "GRCM"
        Range("W5").Value = "LAN"
        Range("W6").Value = "LEN"
        Range("F2").Formula = "=IF(ISNUMBER(FIND($W$2,A2)), 1,IF(ISNUMBER(FIND($W$3,A2)), 1,IF(ISNUMBER(FIND($W$4,A2)), 1,IF(ISNUMBER(FIND($W$5,A2)), 1,IF(ISNUMBER(FIND($W$6,A2)), 1,0)))))"
        Range("F2").AutoFill Destination:=Range("F2:f500000")
        lastRow = ws.Range("A" & ws.Rows.Count).End(xlUp).Row
    
        Set rng = ws.Range("F1:F" & lastRow)
        ' filter and delete all but header row
        With rng
            .AutoFilter Field:=1, Criteria1:="<>1"
            .Offset(1, 0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
        End With
        ' turn off the filters
        ws.AutoFilterMode = False
    Range("B:H,J:N,Q:W").EntireColumn.Delete
    Range("B2").Formula = "=int(D2)"
    Range("B2").AutoFill Destination:=Range("B2:B100000")
    For Each ws In ActiveWorkbook.Sheets
        ws.UsedRange.Value = ws.UsedRange.Value
    Next
    Dim SampleRange As Range
    Dim KeyColumns As Variant
    
    'select the range where data exist
    Set SampleRange = Range("A:C")
    
    'Set the arry size to maximum number of columns
    TotalColumns = SampleRange.Columns.Count
    ReDim KeyColumns(0 To TotalColumns - 1)
    
    'Assign values to each array element
    For i = 0 To TotalColumns - 1
    KeyColumns(i) = i + 1
    Next i
    
    'Remove the duplicates based on all columns
    SampleRange.RemoveDuplicates Columns:=(KeyColumns), Header:=xlYes
    Sheets.Add.Name = "Sheet2"
    End Sub
    
    
    Sub DateEmailRead()
    Range("e2").Formula = "=COUNTIFS('Sheet1'!$c:$c,$D2,'Sheet1'!$b:$b,E$1)"
    Range("e2").AutoFill Destination:=Range("e2:e2000")
    Range("e2:e2000").AutoFill Destination:=Range("e2:AA2000")
    Range("AB2").Formula = "=SUM(E2:AA2)"
    Range("AB2").AutoFill Destination:=Range("AB2:AB2000")
    Range("AE2").Formula = "=(AB2/AD2)*100"
    Range("AE2").AutoFill Destination:=Range("AE2:AE2000")
    Range("AC2").Formula = "=COUNTA($E$1:$AB$1)"
    Range("AC2").AutoFill Destination:=Range("AC2:AC2000")
     Range("AB1").Value = "Total"
     Range("AC1").Value = "Class Days"
     Range("AD1").Value = "Total Classes"
    Range("AE1").Value = "Percentage"
    End Sub
    After the execution of the data, the file that I recieved is this.
    But the issue is that many of the students having siblings shares one laptop uses the id thus due to this one of the sibling is marked absent as they are not using their own id. So I decided to use the siblings data in one sheet and create a connection such that if the students father name is the same as anyother student in the sibling sheet mark his attendance as present.

    Im confused how to do it.
    Last edited by davesexcel; 10-02-2021 at 01:42 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Create connection between Excel and Access - queries
    By jaryszek in forum Access Tables & Databases
    Replies: 40
    Last Post: 10-31-2017, 10:12 AM
  2. Create connection between Excel and Access - queries
    By jaryszek in forum Excel General
    Replies: 5
    Last Post: 10-23-2017, 01:28 AM
  3. Excel and Access Data Connection Issue
    By jefflab1 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 07-10-2015, 06:24 PM
  4. Replies: 1
    Last Post: 10-23-2013, 07:49 AM
  5. Create a User form that populates another sheet in excel with data from Access.
    By laras08 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-01-2013, 04:03 PM
  6. Replies: 2
    Last Post: 07-05-2013, 09:37 AM
  7. Excel VBA makes ODBC connection to Access-How do you close the connection?
    By MrHockey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-04-2010, 06:29 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