Results 1 to 10 of 12

Thread: USER FORM ISSUES: Clear data from various ranges using checkboxes and other issues.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Moderator
    Join Date
    Jul 2012
    Posts
    156
    Rep Power
    14
    First of all press F1 in VBA and lookup Choose
    Code:
            For i = 13 To 24
                If Me("Checkbox" & i) Then Sheets("Schedule").Range(Choose(i-12, "sep_pay", "oct_pay", "nov_pay", "dec_pay", _
                    "jan_pay", "feb_pay", "mar_pay", "apr_pay", "may_pay", "jun_pay", "jul_pay", "aug_pay")).ClearContents
            Next

  2. #2
    Member
    Join Date
    Jul 2013
    Posts
    40
    Rep Power
    0
    OK thanks for the info, indeed it works now, but what if I had j instead of i, why would this also crash?

    Code:
     For j = 13 To 24
                If Me("Checkbox" & j) Then Sheets("Schedule").Range(Choose(j, "sep_pay", "oct_pay", "nov_pay", "dec_pay", _
                    "jan_pay", "feb_pay", "mar_pay", "apr_pay", "may_pay", "jun_pay", "jul_pay", "aug_pay")).ClearContents
            Next
    Guess I 'd better check F1 first but thanx anyway for your help both times.

Similar Threads

  1. Sending Data From User Form To First Empty Row Of Sheets
    By paul_pearson in forum Excel Help
    Replies: 21
    Last Post: 08-14-2013, 11:04 PM
  2. Replies: 9
    Last Post: 12-04-2012, 09:45 PM
  3. Macro To Clear Certain Data Across Many Sheets
    By Howardc in forum Excel Help
    Replies: 2
    Last Post: 12-04-2012, 09:10 AM
  4. Macro to clear data based on color fill
    By Howardc in forum Excel Help
    Replies: 7
    Last Post: 12-03-2012, 09:25 AM
  5. Adding A Menu Bar To A User Form
    By Rasm in forum Excel Help
    Replies: 14
    Last Post: 05-05-2011, 04:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •