Consulting

Results 1 to 3 of 3

Thread: Solved: Named range quickie

  1. #1

    Solved: Named range quickie

    Howdy,

    I have a range named "Doors", but I am having a hard time referring to it in VBA. I am trying to fill a range with a formula and the formula contains the named range. Here's the code that I am trying to use. I know that the quotation thing is a problem but I even tried to double up on them and it still doesn't work. I know that I can just use the cell reference but what would I learn by doing that?? ;-)

    [VBA] With Selection
    .Formula = "=e12/range("Doors")"
    .Copy
    .PasteSpecial Paste:=xlPasteValues
    End With[/VBA]


  2. #2
    I figgered it out myself. I was over complicating things and only had to put "e12/Doors".

    Thanks to anyone who looked.

  3. #3
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Why not just use

    [vba]

    Selection.Value = Range("E12").Value / Range("Doors").Value
    [/vba]

Posting Permissions

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