how to fill consecutive rows in excel

I want to fill say column b from row 6 to  row 9393 with value 'file name abc'
I tried filling row 6 column b with 9393 and drag it down, but that takes too much time.
ease there an easy solution?
Thanks.
ALad2005Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

Saqib Husain, SyedEngineerCommented:
Press F5
type B6:B9393
Press enter or click Ok
Type your text
Press Ctrl-enter
Martin LissOlder than dirtCommented:
This macro is very fast since it fills all the rows at once.

Sub FillRange()
Dim DataRange As Variant ' Must be Variant
Dim lngRow As Long

' This sets up a range of the right size
DataRange = ActiveSheet.Range("B6:B9393")

For lngRow = 1 To UBound(DataRange)
    DataRange(lngRow, 1) = "file name abc"
Next lngRow

Range("B6:B9393").Value = DataRange ' writes all the results back to the range at once
End Sub

Open in new window

Rob HensonFinance AnalystCommented:
Is there data in columns A or C down to the same row?

If so, fill in B6 as required and then just double click the bottom right corner of the cell. This will fill down as far as the data in columns either side.

Alternative similar to Saqib suggestion:

Complete B6 as required
Press F5 and enter the range required including the cell just completed, click OK
Press Ctrl + D to fill down.

Looking at bigger picture, are you repeating the same value all the way down the column? I assume "file name abc" is just an example, where are you getting the file names from?

Thanks
Rob H

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
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

Anil_LadCommented:
thanks everyone.  it worked. thanks for your help.
Anil
Anil_LadCommented:
sorry one more thing.
your solutions work.  column range is filled with a fixed value.
However, what about if I have reference for e.g  =A137.
I want all cells in the range to fill with this value?
can that be done easily too?
Thanks.
Anil
Martin LissOlder than dirtCommented:
I don't know if you are asking Rob or me but

Sub FillRange()
Dim DataRange As Variant ' Must be Variant
Dim lngRow As Long

' This sets up a range of the right size
DataRange = ActiveSheet.Range("B6:B9393")

For lngRow = 1 To UBound(DataRange)
   ' DataRange(lngRow, 1) = "file name abc"
   DataRange(lngRow, 1) = Range("A"& lngRow).Value
'  Or if it's ALWAYS A137
'  DataRange(lngRow, 1) = Range("A137").Value

Next lngRow

Range("B6:B9393").Value = DataRange ' writes all the results back to the range at once
End Sub

Open in new window

ALad2005Author Commented:
thank you guys for your help!
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.