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
 

Some videos you may like

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

Watch MrExcel Video

Forum statistics

Threads
1,108,502
Messages
5,523,295
Members
409,508
Latest member
Afc

This Week's Hot Topics

Top