Excel issue

Duckduck

Well-known member
  • Mar 4, 2023
    1,691
    927
    113
    me method okkomata third party use karanna wenawa, mata ona excel ekenma meka karanna puluwanda balanna. Pena widihata ba wage.
     

    asknrk

    Well-known member
  • Feb 10, 2007
    2,843
    791
    113
    @Thusithaya
    Sub SendReminderEmails()
    Dim ws As Worksheet
    Set ws = ThisWorkbook.Sheets("Sheet1") 'Sheet1 කියලා ඇති එක තමයි මොන sheet එකේද දත්ත තියෙන්නේ.

    Dim dueDateColumn As Range
    Dim emailColumn As Range
    Dim cell As Range
    Dim dueDate As Date
    Dim today As Date

    Set dueDateColumn = ws.Range("A2:A10") 'මෙතන due date column එක select කරන්න.
    Set emailColumn = ws.Range("B2:B10") 'මෙතන email column එක select කරන්න.

    today = Date

    For Each cell In dueDateColumn
    dueDate = cell.Value
    If dueDate = today Then
    SendEmail emailColumn.Cells(cell.Row - dueDateColumn.Row + 1, 1).Value, dueDate
    End If
    Next cell
    End Sub

    Sub SendEmail(recipient As String, dueDate As Date)
    Dim OutlookApp As Object
    Dim OutlookMail As Object

    Set OutlookApp = CreateObject("Outlook.Application")
    Set OutlookMail = OutlookApp.CreateItem(0)

    With OutlookMail
    .To = recipient
    .Subject = "Due Date Reminder"
    .Body = "This is a reminder that you have a task due on " & dueDate & "."
    .Send
    End With

    Set OutlookMail = Nothing
    Set OutlookApp = Nothing
    End Sub

    1. Macro එක Run කරන්න:
      • Excel එකේ Developer tab එකට යන්න.
      • Macros click කරන්න.
      • SendReminderEmails select කරලා Run button එක click කරන්න.
    මෙන්න මේ code එක run කරාම due date එක අද දවසේනම් එම due date එකේ email එකකට reminder email එකක් send කරන්නෙ. "Sheet1" කියන sheet එකේ A2


    cell range එක due date data එකට සහ B2

    cell range එක email addresses එකට භාවිතා කරන්නෙ. ඔබට අවශ්‍ය නම් මෙය adjust කරගන්න පුළුවන්.
    ------ Post added on Jun 29, 2024 at 6:17 PM
     

    Duckduck

    Well-known member
  • Mar 4, 2023
    1,691
    927
    113
    Sub SendReminderEmails()
    Dim ws As Worksheet
    Set ws = ThisWorkbook.Sheets("Sheet1") 'Sheet1 කියලා ඇති එක තමයි මොන sheet එකේද දත්ත තියෙන්නේ.

    Dim dueDateColumn As Range
    Dim emailColumn As Range
    Dim cell As Range
    Dim dueDate As Date
    Dim today As Date

    Set dueDateColumn = ws.Range("A2:A10") 'මෙතන due date column එක select කරන්න.
    Set emailColumn = ws.Range("B2:B10") 'මෙතන email column එක select කරන්න.

    today = Date

    For Each cell In dueDateColumn
    dueDate = cell.Value
    If dueDate = today Then
    SendEmail emailColumn.Cells(cell.Row - dueDateColumn.Row + 1, 1).Value, dueDate
    End If
    Next cell
    End Sub

    Sub SendEmail(recipient As String, dueDate As Date)
    Dim OutlookApp As Object
    Dim OutlookMail As Object

    Set OutlookApp = CreateObject("Outlook.Application")
    Set OutlookMail = OutlookApp.CreateItem(0)

    With OutlookMail
    .To = recipient
    .Subject = "Due Date Reminder"
    .Body = "This is a reminder that you have a task due on " & dueDate & "."
    .Send
    End With

    Set OutlookMail = Nothing
    Set OutlookApp = Nothing
    End Sub

    1. Macro එක Run කරන්න:
      • Excel එකේ Developer tab එකට යන්න.
      • Macros click කරන්න.
      • SendReminderEmails select කරලා Run button එක click කරන්න.
    මෙන්න මේ code එක run කරාම due date එක අද දවසේනම් එම due date එකේ email එකකට reminder email එකක් send කරන්නෙ. "Sheet1" කියන sheet එකේ A2


    cell range එක due date data එකට සහ B2

    cell range එක email addresses එකට භාවිතා කරන්නෙ. ඔබට අවශ්‍ය නම් මෙය adjust කරගන්න පුළුවන්.
    ------ Post added on Jun 29, 2024 at 6:17 PM
    Sorry me code eka koheda run karanne? 3rd party apps mukuth ba, office lap ekak, endpoint security app ekak run wenawa

    Lesiyenma puluwn Google sheets walanam.
    Puluwannam kiyala deepan machan.
    ------ Post added on Jun 29, 2024 at 6:22 PM
     

    asknrk

    Well-known member
  • Feb 10, 2007
    2,843
    791
    113
    @Thusithaya
    1. Excel VBA Developer Tools Enable කරන්න:
      • File -> Options -> Customize Ribbon
      • Developer tab එක check කරන්න.
    2. VBA Code එක එකතු කරන්න:
      • Developer tab එකට යන්න.
      • Visual Basic click කරන්න.
      • New module එකක් add කරන්න: Insert -> Module.
     

    Duckduck

    Well-known member
  • Mar 4, 2023
    1,691
    927
    113
    1. Excel VBA Developer Tools Enable කරන්න:
      • File -> Options -> Customize Ribbon
      • Developer tab එක check කරන්න.
    2. VBA Code එක එකතු කරන්න:
      • Developer tab එකට යන්න.
      • Visual Basic click කරන්න.
      • New module එකක් add කරන්න: Insert -> Module.
    Vb install karanna onada?
     

    asknrk

    Well-known member
  • Feb 10, 2007
    2,843
    791
    113
    @Thusithaya
    ona naha eka excel walma tiyanwa delvoper tab eka penaa naha godak welawata oprtion custom ribbon ghilla active kara ganna
    1719666203936.png


    otherwise ,send a sample excel file , I will do and send , I think you are new to macro & vba
    ------ Post added on Jun 29, 2024 at 6:36 PM
     

    Duckduck

    Well-known member
  • Mar 4, 2023
    1,691
    927
    113
    ona naha eka excel walma tiyanwa delvoper tab eka penaa naha godak welawata oprtion custom ribbon ghilla active kara ganna
    View attachment 232066

    otherwise ,send a sample excel file , I will do and send , I think you are new to macro & vba
    ------ Post added on Jun 29, 2024 at 6:36 PM
    Thanks bn support ekata. me wage than kochchara watinawads kiyala hithenawa ubala wage eun innakota. mata mail eka pm dapan, mage excel sheet eka ewannam.