Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sheets("WOW Reps").Range("B" & Counter) = Cell1.Offset(1,
2).Value Format(Sheets("WOW Reps").Range("C" & Counter), "0.00%") = Cell1.Offset(0, 3).Value Sheets("WOW Reps").Range("D" & Counter) = Cell1.Offset(0, 2).Value Why do I get the error object required on the second line of code? I am trying to format it to % as 0.00%. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Todd,
Try it like this: Sheets("WOW Reps").Range("B" & Counter) = Cell1.Offset(1, 2).Value With Sheets("WOW Reps").Range("C" & Counter) .NumberFormat = "0.00%" .Value = Cell1.Offset(0, 3).Value End With Sheets("WOW Reps").Range("D" & Counter) = Cell1.Offset(0, 2).Value -- Rob Bovey, MCSE, MCSD, Excel MVP Application Professionals http://www.appspro.com/ * Please post all replies to this newsgroup * * I delete all unsolicited e-mail responses * "Todd Huttenstine" wrote in message ... Sheets("WOW Reps").Range("B" & Counter) = Cell1.Offset(1, 2).Value Format(Sheets("WOW Reps").Range("C" & Counter), "0.00%") = Cell1.Offset(0, 3).Value Sheets("WOW Reps").Range("D" & Counter) = Cell1.Offset(0, 2).Value Why do I get the error object required on the second line of code? I am trying to format it to % as 0.00%. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Actually I figured it out after I posted. I changed it
to... Sheets("WOW Reps").Range("B" & Counter) = Cell1.Offset(1, 2).Value Sheets("WOW Reps").Range("C" & Counter) = Format (Cell1.Offset(0, 3).Value, "0.00%") Sheets("WOW Reps").Range("D" & Counter) = Cell1.Offset(0, 2).Value I had my format on the wrong part. What is the benfit of using the with? -----Original Message----- Hi Todd, Try it like this: Sheets("WOW Reps").Range("B" & Counter) = Cell1.Offset(1, 2).Value With Sheets("WOW Reps").Range("C" & Counter) .NumberFormat = "0.00%" .Value = Cell1.Offset(0, 3).Value End With Sheets("WOW Reps").Range("D" & Counter) = Cell1.Offset(0, 2).Value -- Rob Bovey, MCSE, MCSD, Excel MVP Application Professionals http://www.appspro.com/ * Please post all replies to this newsgroup * * I delete all unsolicited e-mail responses * "Todd Huttenstine" wrote in message ... Sheets("WOW Reps").Range("B" & Counter) = Cell1.Offset (1, 2).Value Format(Sheets("WOW Reps").Range("C" & Counter), "0.00%") = Cell1.Offset(0, 3).Value Sheets("WOW Reps").Range("D" & Counter) = Cell1.Offset (0, 2).Value Why do I get the error object required on the second line of code? I am trying to format it to % as 0.00%. . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Todd,
The With...End With construct saves execution time when you are performing multiple operations on the same base object. Your revised method of accomplishing it with one operation will work fine, I was using two to illustrate the two implicit operations that were occurring: applying a number format to a cell and adding a value to a cell. -- Rob Bovey, MCSE, MCSD, Excel MVP Application Professionals http://www.appspro.com/ * Please post all replies to this newsgroup * * I delete all unsolicited e-mail responses * "Todd Huttenstine" wrote in message ... Actually I figured it out after I posted. I changed it to... Sheets("WOW Reps").Range("B" & Counter) = Cell1.Offset(1, 2).Value Sheets("WOW Reps").Range("C" & Counter) = Format (Cell1.Offset(0, 3).Value, "0.00%") Sheets("WOW Reps").Range("D" & Counter) = Cell1.Offset(0, 2).Value I had my format on the wrong part. What is the benfit of using the with? -----Original Message----- Hi Todd, Try it like this: Sheets("WOW Reps").Range("B" & Counter) = Cell1.Offset(1, 2).Value With Sheets("WOW Reps").Range("C" & Counter) .NumberFormat = "0.00%" .Value = Cell1.Offset(0, 3).Value End With Sheets("WOW Reps").Range("D" & Counter) = Cell1.Offset(0, 2).Value -- Rob Bovey, MCSE, MCSD, Excel MVP Application Professionals http://www.appspro.com/ * Please post all replies to this newsgroup * * I delete all unsolicited e-mail responses * "Todd Huttenstine" wrote in message ... Sheets("WOW Reps").Range("B" & Counter) = Cell1.Offset (1, 2).Value Format(Sheets("WOW Reps").Range("C" & Counter), "0.00%") = Cell1.Offset(0, 3).Value Sheets("WOW Reps").Range("D" & Counter) = Cell1.Offset (0, 2).Value Why do I get the error object required on the second line of code? I am trying to format it to % as 0.00%. . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
R/T 424 - Object required Help | Excel Discussion (Misc queries) | |||
Object Required | Excel Discussion (Misc queries) | |||
Object required. | Excel Programming | |||
error 424 - Object Required | Excel Programming | |||
Object required confusion | Excel Programming |