#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting email address names in a range of cells to real names John Excel Worksheet Functions 1 May 19th 10 03:44 PM
using the Excel generic worksheet names instead of user-given names in code Paul Excel Discussion (Misc queries) 5 June 26th 09 08:44 PM
COPYING FORMULA CONTAINING NAMES/RELATIVE RANGE NAMES Bricol Excel Discussion (Misc queries) 0 July 8th 08 03:54 PM
Sorting and matching rows of names with Socials with master list and eliminating the extra names Giacomo Excel Worksheet Functions 1 March 10th 07 01:52 AM
sorting names alphabetically when names may start with numbers John Smith Excel Discussion (Misc queries) 3 May 11th 05 08:06 PM


All times are GMT +1. The time now is 03:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"