Populate different cell than formula

Elston

New Member
Joined
Sep 27, 2016
Messages
10
So in cell D5 i have my rent amount. In cell B5 i have the tenant name. If there is no tenant then in cell B5 i type VACANT.
is there a formula that i can type in cell A5 that will automatically populate the word "VACANT" in cell B5 if there is no rent entered in cell D5?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
A few things:
- Formulas can only return values to the cells that they reside in. They cannot return values to other cells.
- A cell can either have a hard-coded value or a formula in it, but never both at the same time. It is a "one-or-the-other" proposition.

That being said, what you want to do probably can be done using VBA, if that is a viable option for you.
 
Upvote 0
If you place this formula in B5: =IF(D5="","VACANT","") it should work. However, as soon as you enter a tenant name in B5, the formula will be overwritten.
 
Upvote 0
A VBA is an option. do you know the wording? Also i am not very familiar with this so could you also include the how to details? Thank you in advance
 
Upvote 0
So, just to understand the flow, and how you want all of this to work, tell me if this proposal will work for you.
Assuming that column B and column I both have entries in them, if the value in column I is deleted/removed, the value in column B should change to "VACANT"?
And, you want this to happen upon the event of someone manually updating column I?
Is that all correct?
 
Upvote 0
If my previous assumptions are correct, then right-click on the sheet tab name at the bottom of your sheet, select "View Code", and paste this VBA code in the resulting VB Editor window.
It should do what you want automatically.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    Dim isect As Range
    Dim cell As Range
    
'   See if cells being updated are in column I
    Set isect = Intersect(Target, Range("I:I"))
    
'   Loop through updated cells in column I
    If Not isect Is Nothing Then
        For Each cell In isect
            Application.EnableEvents = False
            If cell = "" Then cell.Offset(0, -7) = "VACANT"
            Application.EnableEvents = True
        Next cell
    End If
    
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,325
Members
452,635
Latest member
laura12345

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