![]() |
naming several sheets from cell range
I know how to make a single sheet tab name equal a value in one cell, but
how do I do multiple cells at once? I have a range, cells a1:a50 named 'ATeam'. All fifty cells contain text data or just the value "0" zero. The range is already sorted in ascending order with any zero value cells at the bottom of the range. I want to run a macro that takes that range, and creates a new workbook with sheet names equal to each cell value in that range (except the cells that = 0). I was going to highlight the range, count the cells that contain text, use that value in a loop with Activecell and offset to move down the range from top to bottom creating new sheets... but I can't seem to count the number of cells in the range that equal text to get the loop to value. Any ideas? Thanks, |
naming several sheets from cell range
Sub sheeter()
For i = 1 To 50 v = Sheets("Sheet1").Cells(i, "A").Value If v < 0 Then Sheets.Add.Name = v End If Next End Sub -- Gary's Student gsnu200704 "gifer" wrote: I know how to make a single sheet tab name equal a value in one cell, but how do I do multiple cells at once? I have a range, cells a1:a50 named 'ATeam'. All fifty cells contain text data or just the value "0" zero. The range is already sorted in ascending order with any zero value cells at the bottom of the range. I want to run a macro that takes that range, and creates a new workbook with sheet names equal to each cell value in that range (except the cells that = 0). I was going to highlight the range, count the cells that contain text, use that value in a loop with Activecell and offset to move down the range from top to bottom creating new sheets... but I can't seem to count the number of cells in the range that equal text to get the loop to value. Any ideas? Thanks, |
All times are GMT +1. The time now is 09:50 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com