Excel Macro - Fill Down as many as there is data

Hi,

I would like to have a macro which will fill down, on Sheet1, the content of cell C1 in Column C as many as there is data in column A.
I need that macro to repeat the same for Shee2 and Sheet3

Sample of data attached
mldaigle1Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
I think you forgot to attach the sample workbook.
mldaigle1Author Commented:
oops,

sorry!
filldown.xlsx
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Try this....

Sub FillColumnC()
Dim lr As Long
lr = Cells(Rows.Count, 1).End(xlUp).Row
If lr > 1 Then
    Range("C2:C" & lr).Value = Range("C1").Value
End If
End Sub

Open in new window

Price Your IT Services for Profit

Managed service contracts are great - when they're making you money. Yes, you’re getting paid monthly, but is it actually profitable? Learn to calculate your hourly overhead burden so you can master your IT services pricing strategy.

mldaigle1Author Commented:
sktneer,
Should I use a While do to repeat the same for Sheet2 and Sheet3 in the same macro?
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Oh. I missed that.

Try something like this....

Change the Sheet names as per your requirement....
Sub FillColumnC()
Dim ws As Worksheet
Dim lr As Long
For Each ws In Worksheets
    If ws.Name = "Sheet1" Or ws.Name = "Sheet2" Or ws.Name = "Sheet3" Then
        lr = ws.Cells(Rows.Count, 1).End(xlUp).Row
        If lr > 1 Then
            ws.Range("C2:C" & lr).Value = ws.Range("C1").Value
        End If
    End If
Next ws
End Sub

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
mldaigle1Author Commented:
This is exactly what I wanted,

Big thanks and big kiss,

/mld

talk to you in the next post...
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome mld! Glad it worked for you.

And thanks for the kiss. :) :) :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.