ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Looping through named ranges (https://www.excelbanter.com/excel-programming/297828-looping-through-named-ranges.html)

Tim[_38_]

Looping through named ranges
 
Hi

I want to loop through a number of ranges within a workbook. The
ranges all start Range and then are range1 and range2 etc I then want
to take any links out. I need to leave alone all other named ranges.

I am stuck !!


Sub TryThisOneAtHome()

Sheets("Sheet1").Select

For Each IntM In Names
If IntM.Name Like "Range*" Then
Range(IntM).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
ActiveSheet.Paste
Application.CutCopyMode = False
Else
End If
Next


End Sub

Help !!!

Kind Regards
Tim

Don Guillett[_4_]

Looping through named ranges
 
try this
Sub valueranges()
For Each nn In Names
If nn.Name Like "range*" Then
Range(nn).Value = Range(nn).Value
End If
Next nn
End Sub

--
Don Guillett
SalesAid Software

"Tim" wrote in message
om...
Hi

I want to loop through a number of ranges within a workbook. The
ranges all start Range and then are range1 and range2 etc I then want
to take any links out. I need to leave alone all other named ranges.

I am stuck !!


Sub TryThisOneAtHome()

Sheets("Sheet1").Select

For Each IntM In Names
If IntM.Name Like "Range*" Then
Range(IntM).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=False
ActiveSheet.Paste
Application.CutCopyMode = False
Else
End If
Next


End Sub

Help !!!

Kind Regards
Tim





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

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