Hi Everyone-
I have some code that names a set of columns in 1 of 5 Excel tabs. This code has worked fine for months but now suddenly only selects the first 5 cells in column D and names the range "UWNames". I cannot figure out why it is suddenly and only in column D selecting 5 cells instead of all the cells in the column. Everything is running on XP and Excel 2003, soon to be converted to Windows 7 and Excel 2007.
My code for naming the ranges is below. It is not the best way to select cells but worked for what I needed. Any suggestion on fixing up the code so it only selects the cells with information in them starting at the second cell in the column would be appreciated as well.
Sheets("Names").Range("A2:A" & Range("A2").End(xlDown).Row).Name = "SSNames"
Sheets("Names").Range("B2:B" & Range("B2").End(xlDown).Row).Name = "SSPhones"
Sheets("Names").Range("C2:C" & Range("C2").End(xlDown).Row).Name = "SSIDs"
Sheets("Names").Range("D2:D" & Range("D2").End(xlDown).Row).Name = "UWNames"
Sheets("Names").Range("E2:E" & Range("E2").End(xlDown).Row).Name = "UWPhones"
Sheets("Names").Range("F2:F" & Range("F2").End(xlDown).Row).Name = "UWIDs"
Sheets("Names").Range("G2:G" & Range("G2").End(xlDown).Row).Name = "DUWNames"
Sheets("Names").Range("H2:H" & Range("H2").End(xlDown).Row).Name = "DUWPhones"
Sheets("Names").Range("I2:I" & Range("I2").End(xlDown).Row).Name = "DUWIDs"
Sheets("Names").Range("J2:J" & Range("J2").End(xlDown).Row).Name = "SSTLNames"
Sheets("Names").Range("K2:K" & Range("K2").End(xlDown).Row).Name = "SSTLPhones"
Sheets("Names").Range("L2:L" & Range("L2").End(xlDown).Row).Name = "SSTLIDs"
Sheets("Names").Range("M2:M" & Range("M2").End(xlDown).Row).Name = "SCNames"
Sheets("Names").Range("N2:N" & Range("N2").End(xlDown).Row).Name = "SCPhones"
Sheets("Names").Range("O2:O" & Range("O2").End(xlDown).Row).Name = "SCIDs"
Thanks
I have some code that names a set of columns in 1 of 5 Excel tabs. This code has worked fine for months but now suddenly only selects the first 5 cells in column D and names the range "UWNames". I cannot figure out why it is suddenly and only in column D selecting 5 cells instead of all the cells in the column. Everything is running on XP and Excel 2003, soon to be converted to Windows 7 and Excel 2007.
My code for naming the ranges is below. It is not the best way to select cells but worked for what I needed. Any suggestion on fixing up the code so it only selects the cells with information in them starting at the second cell in the column would be appreciated as well.
Sheets("Names").Range("A2:A" & Range("A2").End(xlDown).Row).Name = "SSNames"
Sheets("Names").Range("B2:B" & Range("B2").End(xlDown).Row).Name = "SSPhones"
Sheets("Names").Range("C2:C" & Range("C2").End(xlDown).Row).Name = "SSIDs"
Sheets("Names").Range("D2:D" & Range("D2").End(xlDown).Row).Name = "UWNames"
Sheets("Names").Range("E2:E" & Range("E2").End(xlDown).Row).Name = "UWPhones"
Sheets("Names").Range("F2:F" & Range("F2").End(xlDown).Row).Name = "UWIDs"
Sheets("Names").Range("G2:G" & Range("G2").End(xlDown).Row).Name = "DUWNames"
Sheets("Names").Range("H2:H" & Range("H2").End(xlDown).Row).Name = "DUWPhones"
Sheets("Names").Range("I2:I" & Range("I2").End(xlDown).Row).Name = "DUWIDs"
Sheets("Names").Range("J2:J" & Range("J2").End(xlDown).Row).Name = "SSTLNames"
Sheets("Names").Range("K2:K" & Range("K2").End(xlDown).Row).Name = "SSTLPhones"
Sheets("Names").Range("L2:L" & Range("L2").End(xlDown).Row).Name = "SSTLIDs"
Sheets("Names").Range("M2:M" & Range("M2").End(xlDown).Row).Name = "SCNames"
Sheets("Names").Range("N2:N" & Range("N2").End(xlDown).Row).Name = "SCPhones"
Sheets("Names").Range("O2:O" & Range("O2").End(xlDown).Row).Name = "SCIDs"
Thanks