LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Trouble Condensing Code


I have the following code that I just know could be condensed, but
can't seem to figure it out. Below is some of the code... the weeks g
to 12 and the days always stay at 1 thru 5.

What it does is put a "1" in the appropriate cell if the check box i
true and leaves it blank if it is false. Is there a way to condens
this code easily? If not I can live with what I have, but it bugs me


CODE:

If frmWeeks.chkWk1Day1 = True Then
ActiveCell.Offset(0, 5).Value = "1"
End If

If frmWeeks.chkWk1Day2 = True Then
ActiveCell.Offset(0, 6).Value = "1"
End If

If frmWeeks.chkWk1Day3 = True Then
ActiveCell.Offset(0, 7).Value = "1"
End If

If frmWeeks.chkWk1Day4 = True Then
ActiveCell.Offset(0, 8).Value = "1"
End If

If frmWeeks.chkWk1Day5 = True Then
ActiveCell.Offset(0, 9).Value = "1"
End If

If frmWeeks.chkWk2Day1 = True Then
ActiveCell.Offset(0, 10).Value = "1"
End If

If frmWeeks.chkWk2Day2 = True Then
ActiveCell.Offset(0, 11).Value = "1"
End If

etc. etc. ..

--
Ikaabo
-----------------------------------------------------------------------
Ikaabod's Profile: http://www.excelforum.com/member.php...fo&userid=3337
View this thread: http://www.excelforum.com/showthread.php?threadid=53199

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Condensing VBA code Brad Excel Discussion (Misc queries) 3 September 9th 09 05:51 PM
Condensing Columns hugsnwally New Users to Excel 0 February 11th 08 10:18 PM
Condensing lists skywalker949494 Excel Worksheet Functions 1 July 6th 05 03:14 PM
Print dialog code trouble Tim[_36_] Excel Programming 1 April 18th 04 08:46 AM
1.)Input Boxes 2.) Condensing a Code David W[_3_] Excel Programming 2 July 17th 03 11:51 PM


All times are GMT +1. The time now is 09:22 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"