[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:

Some videos you may like

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
23,920
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__
 

ayuda42

New Member
Joined
Apr 12, 2013
Messages
16
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,385
Messages
5,601,329
Members
414,445
Latest member
walramgo02

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
Top