0% found this document useful (0 votes)
9 views9 pages

VBA Code Functions Overview

Uploaded by

ziadsherif2210
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views9 pages

VBA Code Functions Overview

Uploaded by

ziadsherif2210
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

VBA Code Functions Overview

Understanding the
`Worksheet_Change` Event
Your Name
Date
Overview of the Code
• • Purpose:
• - Manage user inputs in specified cells (B3,
D3, B8)
• - Validate inputs, record entries, and highlight
occurrences
• - Provide user feedback and track data in the
worksheet
Function: `Worksheet_Change`
• • Definition:
• - Handles changes in the worksheet.
• • Parameters:
• - ByVal Target As Range: Represents the
range of changed cells.
Input Validation
• • Cells: B3, D3, B8
• • Parameters:
• - cellValue (Variant)
• • Purpose:
• - Checks if input is numeric and between
100000 and 999999
• - Clears cell contents if invalid
Handling Input in Cell B3
• • Parameters:
• - lastRow (Long): Next empty row in column F
• - currentDate (Date): Current date
• • Purpose:
• - Record value from B3 into column F
• - Record date in column E
• - Count occurrences in column F and update
B4
• - Clear B3 after entry
Handling Input in Cell D3
• • Parameters:
• - foundCell (Range): Finds occurrences in
column F
• - firstAddress (String): First found cell's
address
• • Purpose:
• - Search for value in column F
• - Highlight found cell in red
• - Write 'Received by KYC' in column G
Handling Input in Cell B8
• • Parameters:
• - foundCell (Range)
• - firstAddress (String)
• • Purpose:
• - Search for value in column F
• - Highlight found cell in blue
• - Write 'Received by KYC' in column G
• - Record current date in column H
• - Clear B8 after checking
Summary
• • Functionality:
• - Validates user inputs
• - Tracks data in the worksheet
• - Provides feedback on data processing
• • Example Usage:
• - Entering numbers in B3 records data
• - Searching in D3 or B8 highlights occurrences
Questions
• Open the floor for any questions regarding the
code and its functionality.

You might also like