+ Reply to Thread
Results 1 to 5 of 5

Is populating one cell based on its unfilled pair possible?

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-25-2014
    Location
    Pennsylvania, US
    MS-Off Ver
    Windows '16
    Posts
    165

    Is populating one cell based on its unfilled pair possible?

    I'm trying to populate one of two cells, whichever is blank, with data based on the second. For example,

    .............A................B..............C
    ...........................Monthly......Annually
    1.....Line item 1.......___...........___
    2.....Line item 2.......___...........___
    3.....Line item 3.......___...........___
    ....

    Where data could be entered into either column B or C, and the other column will perform the appropriate calculation (multiple/divide by 12). And I'm trying to get this to stay in place, so that cell values can be changed repeatedly and the corresponding cell will change automatically.

    Is this possible?

    Thanks.
    Last edited by JYTS; 08-25-2014 at 07:48 AM. Reason: fixed my ugly table

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,028

    Re: Is this possible?

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Never use Merged Cells in Excel

  3. #3
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,644

    Re: Is this possible?

    You would need code for that I think.

    This would go in the worksheet module which you can access by right clicking the sheet tab and selecting View Code.
    
    Private Sub Worksheet_Change(ByVal Target As Range)
    
        If Not Intersect(Target, Range("B2:C100")) Is Nothing Then
            Application.EnableEvents = False
            Select Case Target.Column
                Case 2
                    Target.Offset(, 1).Value = 12 * Target.Value
                Case 3
                    Target.Offset(, -1).Value = Target.Value / 12
            End Select
            Application.EnableEvents = True
        End If
    
    End Sub
    If posting code please use code tags, see here.

  4. #4
    Forum Contributor
    Join Date
    08-25-2014
    Location
    Pennsylvania, US
    MS-Off Ver
    Windows '16
    Posts
    165

    Re: Is populating one cell based on its unfilled pair possible?

    Ay caramba! Quite the way to welcome a brand new member, one sentence and I would have gotten the point.

    Anyways, sorry my title was too vague, I have fixed it!

  5. #5
    Forum Contributor
    Join Date
    08-25-2014
    Location
    Pennsylvania, US
    MS-Off Ver
    Windows '16
    Posts
    165

    Re: Is populating one cell based on its unfilled pair possible?

    Works perfectly, Norie!! Thank you so much! I never would have figured that out.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1