Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel - Fill range with vale 1

Status
Not open for further replies.

micang

Technical User
Aug 9, 2006
626
US
Excel 2007

Hi All,

I have a range that I have defined and I would like to populate all the cells in this range with a value (in this case HC).

The code below puts in the value in the one cell, which I understand, but how can I get it to fill all the cells in the range with the value?

Code:
Dim ads As String  
Dim lastrow as String
lastrow = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row

ad = "J2" & ":" & "j" & lastrow
ads = "HC"
    Range(ad).Select
    ActiveCell.Value = ads

Any guidance in the right direction will be appreciated.

Michael
 
Ramge(ad)=ads
will do it in one go.

combo
 
Many thanks combo.

I was using Range(ad).Value = ads

Appreciate it.

Michael
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top