ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   quick code question (https://www.excelbanter.com/excel-programming/298689-quick-code-question.html)

Tom Ogilvy

quick code question
 
Hard to tell how this really looks, but it will work if it is set up like
this:

If Sheet16.Range("printcell") = 1 Then
Sheet16.Range("exp_loss_page_no").Value= b + 1
Else
Sheet16.Range("exp_loss_page_no") .Value= 0
End If


If you want it all on one line you don't need End if

--
Regards,
Tom Ogilvy

"dave!!" wrote in message
...
can anyone tell me what's wrong with this??

If Sheet16.Range("printcell") = 1 Then Sheet16.Range("exp_loss_page_no")
.Value= b + 1 Else
Sheet16.Range("exp_loss_page_no") .Value= 0
End If





Frank Kabel

quick code question
 
Hi Dave
looks o.k. (besides some linewrapping). What does not work for you?

--
Regards
Frank Kabel
Frankfurt, Germany


dave!! wrote:
can anyone tell me what's wrong with this??

If Sheet16.Range("printcell") = 1 Then
Sheet16.Range("exp_loss_page_no") .Value= b + 1 Else
Sheet16.Range("exp_loss_page_no") .Value= 0
End If


dave!!

quick code question
 
can anyone tell me what's wrong with this??

If Sheet16.Range("printcell") = 1 Then Sheet16.Range("exp_loss_page_no")
..Value= b + 1 Else
Sheet16.Range("exp_loss_page_no") .Value= 0
End If




All times are GMT +1. The time now is 01:40 AM.

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