Using drop down list to populate cells

ExcelBeginner34

New Member
Joined
Mar 2, 2019
Messages
41
Office Version
  1. 2016
Platform
  1. Windows
[TABLE="width: 500"]
<tbody>[TR]
[TD]A
[/TD]
[TD]B
[/TD]
[TD]C
[/TD]
[TD]D

[/TD]
[TD]E
[/TD]
[TD]F
[/TD]
[TD]G
[/TD]
[TD]H
[/TD]
[TD]I
[/TD]
[/TR]
[TR]
[TD]Tenant Name
[/TD]
[TD]Recovery Restrictions (Drop Down List)
[/TD]
[TD]Amount
[/TD]
[TD]Total Budget
[/TD]
[TD]Max Recovery
[/TD]
[TD]Annual Charge To Tenant
[/TD]
[TD]Annul Charge To Landlord
[/TD]
[TD]Quartely Tenant
[/TD]
[TD]Qaurterly Landlord
[/TD]
[/TR]
[TR]
[TD]Tenant A
[/TD]
[TD]E.g Void
[/TD]
[TD]100
[/TD]
[TD]100
[/TD]
[TD][/TD]
[TD][/TD]
[TD]£100
[/TD]
[TD][/TD]
[TD]£25
[/TD]
[/TR]
[TR]
[TD]Tenant B
[/TD]
[TD]E.g Rent inclusive
[/TD]
[TD]200
[/TD]
[TD]200
[/TD]
[TD][/TD]
[TD][/TD]
[TD]£200
[/TD]
[TD][/TD]
[TD]£50
[/TD]
[/TR]
[TR]
[TD]Tenant C

[/TD]
[TD]None
[/TD]
[TD]300
[/TD]
[TD]300
[/TD]
[TD][/TD]
[TD]£300
[/TD]
[TD][/TD]
[TD]£75

[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Hi, I have a sheet in which I have created a drop down list. This contains 4 options Void, Rent Inclusive, Cap/Lease Defect and None. How am I able to set the sheet up so that when the user selects one of these options it automatically populates a cell in the table with a figure copied from another cell? And then if they change the drop down list option it goes back to say blank again?

My table looks like the above. So what I want is to be able to select each of the drop down list options (they will be the same for all col B) and for this to have the following result:

Void - insert the Total Budget Figure (£100) into the Annual Charge to Landlord cell and then in the Quarterly cell show the amount reflecting 25% I,e 25.
Rent inclusive - the same as void above.
None - as per void above but this time populating the Annual Charge to Tenant cell and then the Quarterly figure.
Cap/Lease Defect - no action required.

I have shown as an example in the table how the above would look.

Hope you can help.

Best regards

Iain
 
On the Expenditure Report tab you want to hide the rows where cells in columns C, F and I are all equal to £0.00 and unhide them if the cell in any of the 3 columns does not equal £0.00. Is this correct? I'm afraid that I still don't follow what you mean by:
I would also like to populate the table shown in Columns AJ - AM with data
Can you explain in more detail using examples and referring to specific cells, rows and columns? I need to know specifically what each cell in AJ:AM should contain.
 
Upvote 0

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Hi - yes that’s right on the expenditure tab. Don’t worry about the other table - this isn’t actually that critical.
 
Upvote 0
Try:
Code:
Sub HideRows()
    Application.ScreenUpdating = False
    Dim Val As String, Val2 As String, ws1 As Worksheet, i As Long, v1, item
    Val2 = "0|0|0"
    Set ws1 = Sheets("Expenditure Report")
    v1 = ws1.Range("C14:I" & ws1.Range("I" & Rows.Count).End(xlUp).Row).Resize(, 7).Value
    For i = 1 To UBound(v1, 1)
        Val = v1(i, 1) & "|" & v1(i, 3) & "|" & v1(i, 7)
        If Val = Val2 Then
            Rows(i + 13).Hidden = True
        End If
    Next i
    Application.ScreenUpdating = True
End Sub

Sub UnHideRows()
    Application.ScreenUpdating = False
    Cells.Rows.Hidden = False
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
Thanks - I have added this code but am getting the error message Runtime Error 1004 Unable to set the Hidden property of the range class. When I click debug the below row is highlighted.

Rows(i + 13).Hidden = True

Any thoughts?
 
Upvote 0
Yes it is - that explains it. I have added some code to unprotect the sheet. Any thoughts on getting the Cap/Lease Defect functionality working? In post number 8 above?
 
Last edited:
Upvote 0
Try:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("E:E,AD:AD")) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    On Error GoTo errHandler
    If Target.Column = 5 Then
        Select Case Target.Value
            Case "Void", "Rent Inclusive"
                Cells(Target.Row, 30).Resize(1, 5).ClearContents
                Target.Offset(0, 27) = Target.Offset(0, 24)
                Target.Offset(0, 29) = Target.Offset(0, 24) * 0.25
            Case "None"
                Cells(Target.Row, 30).Resize(1, 5).ClearContents
                Target.Offset(0, 26) = Target.Offset(0, 24)
                Target.Offset(0, 28) = Target.Offset(0, 24) * 0.25
            Case "Select"
                Cells(Target.Row, 30).Resize(1, 5).ClearContents
            Case "Cap/Lease Defect"
                Target.Offset(0, 27) = Target.Offset(0, 24)
                Target.Offset(0, 29) = Target.Offset(0, 24) * 0.25
        End Select
    ElseIf Target.Column = 30 Then
        If Range("E" & Target.Row) = "Cap/Lease Defect" Then
            Target.Offset(0, 1) = Target
            Target.Offset(0, 2) = Target.Offset(0, -1) - Target
        End If
    End If
errHandler:
    Application.EnableEvents = True
End Sub
 
Upvote 0
Great that has worked mostly. The only thing that it isn't doing is showing the quarterly amount for the tenant in AG10. This would be a quarter of the figure in AD if that helps.
 
Upvote 0
How about:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Intersect(Target, Range("E:E,AD:AD")) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    On Error GoTo errHandler
    If Target.Column = 5 Then
        Select Case Target.Value
            Case "Void", "Rent Inclusive"
                Cells(Target.Row, 30).Resize(1, 5).ClearContents
                Target.Offset(0, 27) = Target.Offset(0, 24)
                Target.Offset(0, 29) = Target.Offset(0, 24) * 0.25
            Case "None"
                Cells(Target.Row, 30).Resize(1, 5).ClearContents
                Target.Offset(0, 26) = Target.Offset(0, 24)
                Target.Offset(0, 28) = Target.Offset(0, 24) * 0.25
            Case "Select"
                Cells(Target.Row, 30).Resize(1, 5).ClearContents
            Case "Cap/Lease Defect"
                Target.Offset(0, 27) = Target.Offset(0, 24)
                Target.Offset(0, 29) = Target.Offset(0, 24) * 0.25
        End Select
    ElseIf Target.Column = 30 Then
        If Range("E" & Target.Row) = "Cap/Lease Defect" Then
            Target.Offset(0, 1) = Target
            Target.Offset(0, 2) = Target.Offset(0, -1) - Target
            Target.Offset(0, 3) = Target * 0.25
        End If
    End If
errHandler:
    Application.EnableEvents = True
End Sub
 
Upvote 0
Thanks - that works really well for splitting the costs. The only issue now is that the quarterly figure in AH is still showing as being a quarter of the amount in AC instead of being a quarter of the split amount shown in AF. For example, if AC is £743.37 and AD is £500, AE is £500, AG is 25% of that, AF is the balance of £243.37 but AH is showing as £185.84 which is a quarter of the £743.37 original figure before being apportioned between the Landlord and the Tenant. Any thought on how to solve that one? Best regards
 
Upvote 0

Forum statistics

Threads
1,223,912
Messages
6,175,340
Members
452,638
Latest member
Oluwabukunmi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top