Auto fill

Silo

Active Member
Joined
Mar 8, 2004
Messages
447
Hello Everyone

I have an employee sales report I am working with. It has employee names in column A, Items numbers in column B and Qty in column C.

The first employee name will start in cell A2, B2 will have the first item number sold, than B3 and so on.

If the first employee sold 7 different items there’ll be seven rows with item numbers (B2:B8) but the employee name will only reflect in A2 until the next employee. Example First employee A2, Second Employee A9 and so on.

Is there an auto fill feature (or VBA solution) to copy the employee’s name down then stop when it gets to the next name copy that name down and so?

I like to pivot this data

Thanks
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
Here is a simple loop that will work:

Code:
Sub fillin()

Dim cell As Range
Dim x As String


For Each cell In Range("A2:A20000")
    If cell.Value <> "" Then x = cell.Value
cell.Value = x
Next cell
End Sub
Adjust the range as needed.
 
Upvote 0

Forum statistics

Threads
1,214,638
Messages
6,120,676
Members
448,977
Latest member
moonlight6

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