Filling Data Automatically In Cells

Fill Data Automatically In Cells With Macro

      We used  Column B and C as sample in this template . When data is written into any row of column B and column C, in these columns data are filled up to the most recently used row in sheet .


To Sheet1 Worksheet_Change procedure ,we added the following VBA codes to fill columns :
Private Sub Worksheet_Change(ByVal target As Range)
If target.Column >= 2 And target.Column <= 3 Then
Call AsagiDoldur(target)
End Sub

Sub AsagiDoldur(IslemgorenHucre As Range)
Dim Islemde As Boolean

If Islemde = False Then
Islemde = True
If Not IslemgorenHucre.Row = ActiveCell.SpecialCells(xlCellTypeLastCell).Row Then
Range(IslemgorenHucre.Address, Cells(ActiveCell.SpecialCells(xlCellTypeLastCell).Row, IslemgorenHucre.Column).Address).FillDown
End If

Islemde = False
End If
End Sub

No comments:

Post a Comment