Loops... they're going to be the death of me.

VBA Struggler

New Member
This isin't brain surgery. I can read. I've spent DAYS trying to figure this out and I'm simply spinning my wheels.

Problem

Colum A <-------a buncha junk inbetween----->Column J
John John
Henry
Beth
Francie
Caroline
Bill

I am hopelessly trying to create a subroutine where John is replaced by Henry, then Beth, then Francie, etc. etc. BUT, it can ONLY be J1.

Whomever figures this bad boy out, can you please explain WHY you did whatever you did?

Thanks.

P.S. I actually work in an IT department and I'm too ashamed to ask for their help as none of the them know VBA!!! *sigh*

Thanks again, everyone.

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
let's see if I understand:
you have a table:

A J
 John John Henry Beth Francie Caroline

<tbody>
</tbody>

You want to copy each name from column A to replace the John in Cell J1 and then do something?

Problem

Colum A <-------a buncha junk inbetween----->Column J
John John
Henry
Beth
Francie
Caroline
Bill

I am hopelessly trying to create a subroutine where John is replaced by Henry, then Beth, then Francie, etc. etc. BUT, it can ONLY be J1.
Please explain what you mean by the red highlighted text. Actually, instead of trying to describe in words what you want, why not show us the output you are expecting (unless what you meant by the red highlight text that all entries should somehow go in cell J1)?

code might look something like :

Code:
``````Dim lastRow as Long
Dim currRow as Long

lastRow = Range("A1").end(xlDown).row

for currRow= 1 to lastRow
Cells(1,10) = cells(currRow,1)
.
.
.
next``````

Ok. The Cell J1, which currently has the name John in it, is actually a named range. What it does, really is irrelevent. In fact all the names in column A are named ranges. Once I get the loop performing correctly, each name (and there are a lot more than 6) will go happily on its way doing what I have programmed it to do.

I can't show you any more as I'd never get it past the firewalls. Yup, one of THOSE companies.

So, each name in column A has to go into J1. In turn. And sorry, I didn't mean to put red text in my post.

*sigh* Did that make it any more clear? Or did I just muddle everyone up even more....?

1,196,250
Messages
6,014,246
Members
441,808
Latest member
xplainer

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.

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

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