Results 1 to 6 of 6

If Target.Address = Range("NamedRange").Address Then - is a conflict with another

Threaded View

  1. #1
    Registered User
    Join Date
    08-07-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2010
    Posts
    27

    If Target.Address = Range("NamedRange").Address Then - is a conflict with another

    Hi All,

    I have a little problem, and I am unsure if I am doing this right.
    I have a couple of If statements that seem to conflict with each other. Appreciate any help

    Private Sub Worksheet_Change(ByVal Target As Range)
    
    If Target.Address = Range("metres").Address Then
        Range("feet").Formula = "="metres"*3.28083"
        Range("yards").Formula = "="metres"*1.09361"
    End If
    
    If Target.Address = Range("yards").Address Then
        Range("metres").Formula = "="yards"*0.9144"
        Range("feet").Formula = "="yards"*3"
    End If
    
    If Target.Address = Range("feet").Address Then
        Range("metres").Formula = "="feet"*0.3048"
        Range("yards").Formula = "="feet"*0.3333333"
    End If
    
    End Sub
    So basically, if I enter one value, the other two cells should automatically populate with the correct answer.
    The three cells have been named per "metres", "yards", & "feet".

    What am I doing wrong?
    Last edited by limewire; 11-01-2022 at 11:00 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] If Target.Cells(1).Address = Range("$B$5": ..(?)..)
    By Marcin4111 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-22-2015, 06:57 AM
  2. Replies: 1
    Last Post: 02-15-2014, 04:05 PM
  3. [SOLVED] Index, Address and CountIF - Finding the "Last" Non Blank Column through named range
    By dluhut in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-15-2013, 12:15 PM
  4. Open files from FTP server (works with "servername" but doesn't work with "ip address")
    By adammsu1983 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-24-2012, 04:30 PM
  5. Replies: 2
    Last Post: 06-29-2012, 06:32 AM
  6. Replies: 2
    Last Post: 06-24-2012, 02:55 PM
  7. Naming a range inside a formula using "Address"
    By mcke1610 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-23-2007, 12:41 PM

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