+ Reply to Thread
Results 1 to 4 of 4

Thread: offset formatting question

  1. #1
    Registered User
    Join Date
    05-04-2009
    Location
    Philadelphia, pa
    MS-Off Ver
    Excel 2003
    Posts
    8

    offset formatting question

    i have a range of cells which is nxn where n>1. i want to place a header 2 rows above this range which is aligned on the left. this is what i tried:

    Range("givenMatrix").Offset(-2, 0).Value = "YOUR MATRIX"
    but this prints out an nxn matrix where all the values are "YOUR MATRIX". how can i select just the anchor cell of "givenMatrix" and move 2 rows above that to place the header?

    thanks for any help.
    Last edited by justin111; 05-04-2009 at 08:17 PM.

  2. #2
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,777

    Re: offset formatting question

    Try
    Range("givenMatrix").Offset(-2, 0)(1).Value = "YOUR MATRIX"
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    05-04-2009
    Location
    Philadelphia, pa
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: offset formatting question

    Quote Originally Posted by shg View Post
    Try
    Range("givenMatrix").Offset(-2, 0)(1).Value = "YOUR MATRIX"
    brilliant. thanks a bunch.
    Last edited by justin111; 05-04-2009 at 08:13 PM.

  4. #4
    Forum Guru shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007, 2010
    Posts
    25,777

    Re: offset formatting question

    Please mark this thread as solved, and start a new thread for your unrelated question.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

+ 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.2.0