ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Placing value in every col of a named range row (https://www.excelbanter.com/excel-programming/423497-placing-value-every-col-named-range-row.html)

John

Placing value in every col of a named range row
 
What code do I use to place dashes in all cells of row 2 of ToTable? I tried
Sheets(ToSheet).Range(ToTable)(2).Value = "'- - - - -"
but this seems to put the dashes in only row 1 col 2 cell.

I appreciate your help, -John

Gary''s Student

Placing value in every col of a named range row
 
This assumes that there is a block of cells with the Defined Name "qwerty":

Sub dural()
Set r = Range("qwerty")
Set r2 = r(1).Offset(1, 0).EntireRow
Set r3 = Intersect(r, r2)
r3.Value = "-----"
End Sub

r is the range of the table
r2 is the first cell of the second row of the table
r3 is the second row of the table
--
Gary''s Student - gsnu200832


"John" wrote:

What code do I use to place dashes in all cells of row 2 of ToTable? I tried
Sheets(ToSheet).Range(ToTable)(2).Value = "'- - - - -"
but this seems to put the dashes in only row 1 col 2 cell.

I appreciate your help, -John



All times are GMT +1. The time now is 04:02 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com