I have this code, and would like to know what the numbers mean:
Please Login or Register to view this content.
I have this code, and would like to know what the numbers mean:
Please Login or Register to view this content.
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
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.
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.
ok, thank you.
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
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks