ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Using range to fill in cell values (https://www.excelbanter.com/excel-programming/394399-using-range-fill-cell-values.html)

Nicole

Using range to fill in cell values
 
I have this bit of code that I use to fill in sheet names for a large report.
I am trying to conserve space. Also, it doesn't work. I get a 438 runtime
error. I need to know how to fix this so the object does work.

'Rename Sheets
i = 1
For Each c In SheetNames
Sheets(i).Names = c.Value
i = i + 1
If i = 19 Then Exit For
Next c

Regards,
N
--
Nicole
BI Programmer/Analyst
Consultant

John Bundy

Using range to fill in cell values
 
Where are you getting SheetNames, and what is it?
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Nicole" wrote:

I have this bit of code that I use to fill in sheet names for a large report.
I am trying to conserve space. Also, it doesn't work. I get a 438 runtime
error. I need to know how to fix this so the object does work.

'Rename Sheets
i = 1
For Each c In SheetNames
Sheets(i).Names = c.Value
i = i + 1
If i = 19 Then Exit For
Next c

Regards,
N
--
Nicole
BI Programmer/Analyst
Consultant


Nicole

Using range to fill in cell values
 

--
Nicole
BI Programmer/Analyst
Consultant


"John Bundy" wrote:

Where are you getting SheetNames, and what is it?
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Nicole" wrote:

I have this bit of code that I use to fill in sheet names for a large report.
I am trying to conserve space. Also, it doesn't work. I get a 438 runtime
error. I need to know how to fix this so the object does work.

'Rename Sheets
i = 1
For Each c In SheetNames
Sheets(i).Names = c.Value
i = i + 1
If i = 19 Then Exit For
Next c

Regards,
N
--
Nicole
BI Programmer/Analyst
Consultant


Nicole

Using range to fill in cell values
 
It is a set range (object) that I created. It is bound early and contains
string variables.
--
Nicole
BI Programmer/Analyst
Consultant


"John Bundy" wrote:

Where are you getting SheetNames, and what is it?
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Nicole" wrote:

I have this bit of code that I use to fill in sheet names for a large report.
I am trying to conserve space. Also, it doesn't work. I get a 438 runtime
error. I need to know how to fix this so the object does work.

'Rename Sheets
i = 1
For Each c In SheetNames
Sheets(i).Names = c.Value
i = i + 1
If i = 19 Then Exit For
Next c

Regards,
N
--
Nicole
BI Programmer/Analyst
Consultant



All times are GMT +1. The time now is 02:49 PM.

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