Dear VBA Experts
I have written a code for equal distribution of Budget Data based on condition.
The user will enter annual budget number in Column K (highlighted in Green) and based on condition in Column N (highlighted in Yellow), the data will be divided by 12 and it need to be equally distributed from Colum P to Column AA. The condition for distribution is ‘Y’ (Yes)/ ‘N’ (No).
I have also attached the sample file.Budget_Input Form.xlsm
Please help me with fixing this issue.![]()
Sub BudDist() Dim myCell As Range Dim Data As Long Dim lr As Long Dim a lr = Cells(Rows.Count, 11).End(xlUp).Row For Each myCell In Range("K39:K" & lr) If UCase(myCell.Offset(, 3).Value) = "Y" Then Data = myCell.Value / 12 a = myCell.Row Range("P" & a & ":AA" & a).Value = Data End If Next myCell End Sub
Thanks,
Nisha
Bookmarks