how to fill in names in cells automatically

J

john

I'm looking for a simple way to fill in names are existing
spreadsheet. In column a there is a customer name, and beside it in
column B. there is a list of products that are customer purchase, with
the list going B1, B2, B3, etc. now when we get to the bottom of that
customer's list the next customer appears in column a, and now the
products they participate in will go down column B. now the various
customers order different amounts of products so the space between
customer names in column a does vary somewhat. Now when I do a sort by
product kind I can't see which customer ordered because unless it
falls on the same row as a customer name it actually will be a blank
cell. What I was doing was selecting the first name and dragging it
down however many blank cells were between it and the next name and
then doing a fill down. This would take me a lifetime to complete and
therefore that's why I asking you people to help. Thank you in advance
for any help you may offer.
 
D

Don Guillett Excel MVP

I'm looking for a simple way to fill in names are existing
spreadsheet. In column a there is a customer name, and beside  it in
column B. there is a list of products that are customer purchase, with
the list going B1, B2, B3, etc. now when we get to the bottom of that
customer's list the next customer appears in column a, and now the
products they participate in will go down column B. now the various
customers order different amounts of products so the space between
customer names in column a does vary somewhat. Now when I do a sort by
product kind I can't see which customer ordered because unless it
falls on the same row as a customer name it actually will be a blank
cell. What I was doing was selecting the first name and dragging it
down however many blank cells were between it and the next name and
then doing a fill down. This would take me a lifetime to complete and
therefore that's why I asking you people to help. Thank you in advance
for any help you may offer.

"If desired, send your file to dguillett @gmail.com I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results."
 
D

Don Guillett Excel MVP

"If desired, send your file to dguillett  @gmail.com I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results."

Option Explicit
Sub FillInCustomersSAS()
Dim i As Long
For i = Cells(Rows.Count, 2).End(xlUp).Row To 2 Step -1
If Cells(i, 2) <> "" Then Cells(i, 1) = _
Cells(i, 2).Offset(, -1).End(xlUp)
Next i
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top