+ Reply to Thread
Results 1 to 6 of 6

calling string as a matrix

  1. #1
    Registered User
    Join Date
    02-21-2009
    Location
    Charlottesville, Va
    MS-Off Ver
    Excel 2007 Pro
    Posts
    4

    calling string as a matrix

    I need to sort a group of tables as
    1: a b c......32: a b c......63: a b c......94: a b c
    2: a b c......33: a b c......64: a b c......95: a b c
    3: a b c......34: a b c......65: a b c......96: a b c

    ...................................................124: a b c

    There is a lot more code here, but the only part that is not testing out correctly is the matricies. Are they being called wrong, or does it just not function this way?


    Please Login or Register  to view this content.
    Last edited by VBA Noob; 03-01-2009 at 01:58 PM.

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

    Re: calling string as a matrix

    Welcome to the forum.

    I have no idea what you're trying to do, but if offX and offY are indeed offsets, then things like this:
    Please Login or Register  to view this content.
    ... should be like this:
    Please Login or Register  to view this content.
    ... or better,
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    02-21-2009
    Location
    Charlottesville, Va
    MS-Off Ver
    Excel 2007 Pro
    Posts
    4

    Re: calling string as a matrix

    Range("a1:b2")(2,1) is Range("a2") >row 2 column 1 of Range("a1:b2")<

    whereas Range("a1:b2").offset(2,1) is Range("b3:c5").

    My grid references are working fine.

    When I say Range("F33:T63")(offY, offX).value = 1, all the proper cells are entered as 1.

    But, when I say ("F33:T63")(offY, offX).value = newReg(y, x) nothing happens.
    Last edited by airman000616; 03-03-2009 at 10:41 PM.

  4. #4
    Registered User
    Join Date
    02-21-2009
    Location
    Charlottesville, Va
    MS-Off Ver
    Excel 2007 Pro
    Posts
    4

    Re: calling string as a matrix

    Verbage may be confusing things here, I started programming in C++. I recognize "Dim temp(1 To 10) As String" as being called a series and "Dim temp(1 To 10, 1 To 20) As String" as being called a Matrix. This is the code that is troubling me. newReg(y, x) is not returning any values.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: calling string as a matrix

    Sorry, you're going to have to back up to the beginning and explain clearly if you want help.

  6. #6
    Registered User
    Join Date
    02-21-2009
    Location
    Charlottesville, Va
    MS-Off Ver
    Excel 2007 Pro
    Posts
    4

    Re: calling string as a matrix

    ok, I have a banking register with 124 rows and 3 columns: type of transaction, date, amount. I have it broken into four tables so that I can see the entire register without scrolling. I am planning to use a user form to add entries to the register, so I am trying to use the string form newReg(1 To 150, 1 To 3) to add and sort entries in the register.

    The For loops that I am using to step through each cell of the tables are working fine.

    If I run the code saying "Range(x, y) = 1" then the screen flickers and all the proper cells have 1 entered in them.

    If I run the same code saying "Range(x, y) = newReg(a, b)" then the mouse pointer turns into an hourglass for a moment, but nothing happens.

    There is something about my use of "newReg(1 To 150, 1 To 3) As String" that is not working.
    Last edited by airman000616; 03-07-2009 at 02:15 PM.

+ 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