ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Rond merge help (https://www.excelbanter.com/excel-programming/432809-rond-merge-help.html)

Andrew P.

Rond merge help
 
Hi All

Im trying to make the example 1 work from Copy3, but Im having trouble
referring to multiple named ranges - most I can get to work is one named
range (always only 1 [merged] cell). Whats the correct method?
- Set sourceRange = .Range("")

Also, is there a way to get the names of the ranges into row 1?

Thanks a heap
Andrew

Gary''s Student

Rond merge help
 
To get range names into row 1, try:

Sub NameLister()
Dim n As Name
i = 0
For Each n In ThisWorkbook.Names
Range("A1").Offset(0, i).Value = n.Name
i = i + 1
Next
End Sub

--
Gary''s Student - gsnu200901


"Andrew P." wrote:

Hi All

Im trying to make the example 1 work from Copy3, but Im having trouble
referring to multiple named ranges - most I can get to work is one named
range (always only 1 [merged] cell). Whats the correct method?
- Set sourceRange = .Range("")

Also, is there a way to get the names of the ranges into row 1?

Thanks a heap
Andrew


Andrew P.

Ron merge help
 
Hi Gary

Sorry, I dont follow it - is this meant to sit in the merge macro? FYI the
code Im using is from http://www.rondebruin.nl/copy3.htm

Thanks
Andrew

"Gary''s Student" wrote:

To get range names into row 1, try:

Sub NameLister()
Dim n As Name
i = 0
For Each n In ThisWorkbook.Names
Range("A1").Offset(0, i).Value = n.Name
i = i + 1
Next
End Sub

--
Gary''s Student - gsnu200901


"Andrew P." wrote:

Hi All

Im trying to make the example 1 work from Copy3, but Im having trouble
referring to multiple named ranges - most I can get to work is one named
range (always only 1 [merged] cell). Whats the correct method?
- Set sourceRange = .Range("")

Also, is there a way to get the names of the ranges into row 1?

Thanks a heap
Andrew



All times are GMT +1. The time now is 09:38 AM.

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