Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default Need macro to copy a list of named cells between worksheets

I have a workbook containing a worksheet that has a bunch of company info and
another that contains new info to replace the old info. Cells on each sheet
are in different locations, but are named and I have a table of from/to names
off to the side in a worksheet that I update occasionally when new info is
added. How do I write a macro that will copy all of the FROMNAMES column cell
name contents to the corresponding cell name in the TONAMES column?

.... X Y
..
22 FROMNAMES TONAMES
23 newcompany company
24 newcontact contact
25 newphone phone
26 newfax fax
27 newemail email

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default Need macro to copy a list of named cells between worksheets

Here's an example

Dim cell As Range
Dim i As Long
For Each cell In Range("Bob")
i = i + 1
Range("Lynne")(i).Value = cell.Value
Next cell


--

HTH

RP
(remove nothere from the email address if mailing direct)


"John" wrote in message
...
I have a workbook containing a worksheet that has a bunch of company info

and
another that contains new info to replace the old info. Cells on each

sheet
are in different locations, but are named and I have a table of from/to

names
off to the side in a worksheet that I update occasionally when new info is
added. How do I write a macro that will copy all of the FROMNAMES column

cell
name contents to the corresponding cell name in the TONAMES column?

... X Y
.
22 FROMNAMES TONAMES
23 newcompany company
24 newcontact contact
25 newphone phone
26 newfax fax
27 newemail email



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default Need macro to copy a list of named cells between worksheets

This suggestion moves the names in range Bob to the coresponding cell in
Lynne. I want the names in Bob & Lynne to be recognized as cell names and the
contents of eac named cell in list Bob be moved to the corresponding cell
named in Lynne. Ie., I need another level of indirection.

"Bob Phillips" wrote:

Here's an example

Dim cell As Range
Dim i As Long
For Each cell In Range("Bob")
i = i + 1
Range("Lynne")(i).Value = cell.Value
Next cell


--

HTH

RP
(remove nothere from the email address if mailing direct)


"John" wrote in message
...
I have a workbook containing a worksheet that has a bunch of company info

and
another that contains new info to replace the old info. Cells on each

sheet
are in different locations, but are named and I have a table of from/to

names
off to the side in a worksheet that I update occasionally when new info is
added. How do I write a macro that will copy all of the FROMNAMES column

cell
name contents to the corresponding cell name in the TONAMES column?

... X Y
.
22 FROMNAMES TONAMES
23 newcompany company
24 newcontact contact
25 newphone phone
26 newfax fax
27 newemail email




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
John
 
Posts: n/a
Default Need macro to copy a list of named cells between worksheets

Duh! I figured it out myself. All I needed to do was replace the cell equate
line w/

Range(Range("newentry")(i)).Value = Range(cell).Value

and I get the needed level of indirection.

"John" wrote:

This suggestion moves the names in range Bob to the coresponding cell in
Lynne. I want the names in Bob & Lynne to be recognized as cell names and the
contents of eac named cell in list Bob be moved to the corresponding cell
named in Lynne. Ie., I need another level of indirection.

"Bob Phillips" wrote:

Here's an example

Dim cell As Range
Dim i As Long
For Each cell In Range("Bob")
i = i + 1
Range("Lynne")(i).Value = cell.Value
Next cell


--

HTH

RP
(remove nothere from the email address if mailing direct)


"John" wrote in message
...
I have a workbook containing a worksheet that has a bunch of company info

and
another that contains new info to replace the old info. Cells on each

sheet
are in different locations, but are named and I have a table of from/to

names
off to the side in a worksheet that I update occasionally when new info is
added. How do I write a macro that will copy all of the FROMNAMES column

cell
name contents to the corresponding cell name in the TONAMES column?

... X Y
.
22 FROMNAMES TONAMES
23 newcompany company
24 newcontact contact
25 newphone phone
26 newfax fax
27 newemail email




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
copy and pasting a find all list into another column Ben Excel Discussion (Misc queries) 18 December 31st 05 11:51 PM
Macro Help In Excel welshlad Excel Discussion (Misc queries) 14 October 26th 05 02:34 PM
Macro help - copy a cell down gjcase Excel Discussion (Misc queries) 3 September 4th 05 05:09 AM
Macro to copy cells Esrei Excel Discussion (Misc queries) 2 August 11th 05 11:31 AM
copy group of cells to another group of cells using "IF" in third Chuckak Excel Worksheet Functions 2 November 10th 04 07:04 PM


All times are GMT +1. The time now is 09:59 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"