Hi
I just joined this forum and this is the first time I've ever really used a forum so I'm not sure how this works. But can someone help me with trying to figure out how to make this macro, which I'm also new at since I've never really programmed before. Below is the code:
Dim s As Integer
Sheets("Instructions").Select
s = Range("C42").Value
Sheets("BB").Select
Range("A1").Select
Dim i As Integer
i = 0
Do Until i = s
Selection.End(xlDown).Select
Selection.CurrentRegion.Select
ActiveWorkbook.Names.Add Name:="Apple", RefersToR1C1:=- "=BB!R5C1:R23C5"
Selection.End(xlDown).Select
i = i + 1
Loop
So basically what I'm trying to do is create a macro that will select a current region and name define it then and continue until there are no current regions which is defined through "s". But I don't know how to get the name define to change from "apple" everytime it goes through the loop. Is it possible to make it reference a cell within the current region as a title instead of "apple".
Thanks!
IcDaStar
I just joined this forum and this is the first time I've ever really used a forum so I'm not sure how this works. But can someone help me with trying to figure out how to make this macro, which I'm also new at since I've never really programmed before. Below is the code:
Dim s As Integer
Sheets("Instructions").Select
s = Range("C42").Value
Sheets("BB").Select
Range("A1").Select
Dim i As Integer
i = 0
Do Until i = s
Selection.End(xlDown).Select
Selection.CurrentRegion.Select
ActiveWorkbook.Names.Add Name:="Apple", RefersToR1C1:=- "=BB!R5C1:R23C5"
Selection.End(xlDown).Select
i = i + 1
Loop
So basically what I'm trying to do is create a macro that will select a current region and name define it then and continue until there are no current regions which is defined through "s". But I don't know how to get the name define to change from "apple" everytime it goes through the loop. Is it possible to make it reference a cell within the current region as a title instead of "apple".
Thanks!
IcDaStar