[VBA] Issues with some VBA translation

ayuda42

New Member
Joined
Apr 12, 2013
Messages
16
Hi all,

I find myself attempting to learn VBA bit by bit, kicking myself in the butt as I had chosen to ignore excel through my college (NOBODY USES MATLAB (EXCEPT R&D) PROFESSORS!)

Anyway, on to my issue - I know how to approach this in a programming sense, I just have no idea how to translate it into VBA.

This is my scenario -

I have a bunch of data that I import from a .csv file. Then, on the main sheet titled (Schedule). This occupies cols A through I. Columns K, L are calculated values based upon the previous columns.

I now run into the following issue: I created a calculations sheet, which is named after colA/B. I need to create this sheet for each row of data. This sheet is populated with data from cols A-L, then does some calculations which are sent back to the main sheet (Schedule) for the remaining columns M-Q.

Programming-wise, I'd probably treat it something like this (pseudocode)

Code:
data = dataread(export.csv)
z = size(data)
for i = 1:z
    % do calculations for cols K/L
    copysheet(i)
    % do calcs for remaining cols
end

What I'm having issues conceptualizing in vba is keeping track of the index - is this even needed? How would I go about populating the calcs sheet with data from the correct row?

If this is extremely vague, let me know and I can try to explain more or post the spreadsheet.
 
Last edited:

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Does the VBA syntax

Code:
For i = 1 to Z Step 1
    
    ' do stuff with i

Next i
help with your problem?
(the "Step 1 " is optional, but included for those cases where you want something other than 1 (negative step is OK in VBA__
 
Upvote 0
Does the VBA syntax

Code:
For i = 1 to Z Step 1
    
    ' do stuff with i

Next i
help with your problem?
(the "Step 1 " is optional, but included for those cases where you want something other than 1 (negative step is OK in VBA__

Hahahaha, no, not really. I'm going to spend a weekend with a book on this stuff and I'll report back.
 
Upvote 0

Forum statistics

Threads
1,214,780
Messages
6,121,527
Members
449,037
Latest member
tmmotairi

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top