+ Reply to Thread
Results 1 to 6 of 6

meaning of the code

  1. #1
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    meaning of the code

    I have this code, and would like to know what the numbers mean:
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: meaning of the code

    For r = 1 To 500 ' looping from rows 1 to 500
    For c = 1 To 12 looping from columns 1 to 12
    so for every loop in row, the code has to loop 12 times
    Row1, column1
    Row1, column2
    Row1, column3
    and so on

  3. #3
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: meaning of the code

    ok, thank you, I get error on p = "D:\Formula\" line, and trying to figure out why I cannot run that macro. If you can help explain the lines or what am I missing.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: meaning of the code

    I do not see what is the problem with that line.

    You are calling a function called
    Cells(r, c) = GetValue(P, F, s, a)
    and the arguments are in bracket and one of them is P, which you have assigned it as string on this line
    "D:\Formula\".
    Last edited by AB33; 09-28-2016 at 01:56 PM.

  5. #5
    Forum Contributor
    Join Date
    10-24-2012
    Location
    San Diego, USA
    MS-Off Ver
    Excel 2019
    Posts
    844

    Re: meaning of the code

    ok, thank you.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,422

    Re: meaning of the code

    The GetValue function, a User Defined Function (UDF), gets values from Closed workbook. This is documented at John Walkenbach's Spreadsheet Page web site: http://spreadsheetpage.com/index.php...a_closed_file/

    You pass it the path for the workbook, the workbook name (including its file extension), the worksheet to be processed and the cell address to get the data from. In your case, you are accessing the D: drive on your computer, the Formula folder, and the Inventory.xls workbook within that folder.

    Your code simply loops through 500 rows by 12 columns, 6,000 cells, returning cell values one by one. Personally, I'd open the workbook, get all the cells in one go and close the workbook.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Can you please tell me what is the meaning of =+A1*B1 vs =A1*B1
    By Novice_To_Excel in forum Excel General
    Replies: 4
    Last Post: 03-07-2015, 01:24 PM
  2. Properties meaning
    By DeeptiBhuti in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-27-2012, 06:12 AM
  3. #REF! Meaning
    By este994 in forum Excel General
    Replies: 1
    Last Post: 08-18-2011, 10:23 AM
  4. Meaning of E
    By Ganivada in forum Excel General
    Replies: 2
    Last Post: 11-27-2009, 11:09 AM
  5. [SOLVED] The meaning of macro
    By Jentan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-20-2006, 11:25 AM
  6. meaning of #########
    By dick in forum Excel General
    Replies: 2
    Last Post: 01-10-2006, 09:30 AM
  7. [SOLVED] The meaning and uses for ans
    By Pat in forum Excel General
    Replies: 3
    Last Post: 04-04-2005, 06:06 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