Two columns & cross fill input
Results 1 to 2 of 2

Thread: Two columns & cross fill input
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Nov 2016
    Location
    Sweden
    Posts
    12
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Two columns & cross fill input

    Hi,

    I have a spreadsheet where I have column A and column B.

    In column A I want a price with V.A.T (=B1*1.25) and in column B i want a price without V.A.T (=A1*0.8).

    What I mean with that is that if I enter a value in column B I want Excel to automatically fill in the value in column A.
    And if I enter a value in column A I want Excel to automatically fill in the value in column B.

    Can you get this type of cross referencing to work in any way?

    Probably a noob question but couldn't find anything on Google or at least I'm not searching for the right terms...

    Appreciate your help!

    /Adam, Sweden

  2. #2
    Board Regular
    Join Date
    Aug 2012
    Posts
    245
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Two columns & cross fill input

    Hi Adam,

    With formulae you're always going to run into issues with circular references.

    You could use a 'WorksheetChange_Event in VBA though:

    Code:
    Private Sub Worksheet_Change(ByVal Target As Range)
        If IsNumeric(Target.Value) And Target.column = 1 then Target.offset(0,1) = Target.Value *1.25
    
        If IsNumeric(Target.Value) And Target.column = 2 then Target.offset(0,-1) = Target.Value *0.8
    
    End Sub
    Just paste that into the code window of the relevant worksheet​ (i.e. NOT in a module).

    EDIT: I actually got the 1.25 and the 0.8 the wrong way round, but you get the idea.

    Cheers
    JB
    Last edited by bellman101; Nov 25th, 2017 at 06:36 AM.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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