Returning a function from a Loop

gregmorozzi

New Member
Joined
Sep 30, 2014
Messages
1
Hi All,

I'm having some trouble returning functions from a loop and I'm looking for any advice. Here is the scenario

Input:
I am reading in one column of data just like the column below (except a lot longer)

Source
S1 A
S4 C
S2 D
S3 A

<tbody>
</tbody>


I want to write a program that generalized the 2nd and 4th digits so it can be picked up by the the code. I'm calling the 2nd digit i and the 4th j. I'm trying to write something that says

For Cells(K,1) = "Si j" 'where K loops through each row in the input
var = sijx 'var is an intermediate variable and sijx is nothing other that a place holder

For example
Evaluate the first row (S1 A): I need
For Cells(1,1) = "S1 A"
var=s1Ax ' where s1Ax is a function called later in the program

Is this possible in VBA? I really appreciate any advice someone might have for me. Thanks in advance
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,214,833
Messages
6,121,862
Members
449,052
Latest member
Fuddy_Duddy

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