ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Add Names (https://www.excelbanter.com/excel-programming/284559-add-names.html)

Jamal[_2_]

Add Names
 
I have a long and wide spreadsheet. I need to add names to
each cell in column 93. The names should be the text in
the relevant row in colum 2. The columns in the middle are
full of other information.

I tried the following code. The error message comes up
as "That name is not Valid".

For Each MyCell In MyRange
MyCell.Offset(0, 92).Name = MyCell.Text
Next MyCell


Any help is appriciated. Thanks in advance.

Don Guillett[_4_]

Add Names
 
try

For Each MyCell In MyRange
MyCell.Offset(0, 92).Name = MyCell.Text
Next MyCell


For Each MyCell In MyRange
MyCell.Offset(0, 92).value = MyCell
Next MyCell


--
Don Guillett
SalesAid Software

"Jamal" wrote in message
...
I have a long and wide spreadsheet. I need to add names to
each cell in column 93. The names should be the text in
the relevant row in colum 2. The columns in the middle are
full of other information.

I tried the following code. The error message comes up
as "That name is not Valid".

For Each MyCell In MyRange
MyCell.Offset(0, 92).Name = MyCell.Text
Next MyCell


Any help is appriciated. Thanks in advance.




Chip Pearson

Add Names
 
Jamal,

Try something like the following:

Dim MyCell As Range
For Each MyCell In Application.Intersect(ActiveSheet.UsedRange, _
ActiveSheet.Columns(93))
MyCell.Name = MyCell.EntireRow.Cells(1, "B").Text
Next MyCell



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Jamal" wrote in message
...
I have a long and wide spreadsheet. I need to add names to
each cell in column 93. The names should be the text in
the relevant row in colum 2. The columns in the middle are
full of other information.

I tried the following code. The error message comes up
as "That name is not Valid".

For Each MyCell In MyRange
MyCell.Offset(0, 92).Name = MyCell.Text
Next MyCell


Any help is appriciated. Thanks in advance.





All times are GMT +1. The time now is 07:35 PM.

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