Results 1 to 36 of 36

Quicker way to enter in multiple vba if statements

Threaded View

  1. #1
    Registered User
    Join Date
    02-27-2005
    Posts
    35

    Quicker way to enter in multiple vba if statements

    I have attached a copy of my monthly work schedule. Sorry if it looks too noobish but I am.
    The question I have is on the schedule right now, it uses to of the same schedule, one is called request off and the other the final. The request off right now is where all changes are made, and they reflect on the final. I did it this way because I could not figure out how to make the cells autofill according to the day of the week, like if it was friday i needed it to fill in the shifts and normal days off automatically. What I am trying to do now is eliminate the need for the second schedule, the request off one. I think I have figured out how to have the cells autofilled according to the day of the week, and also let the user enter in other stuff such as sick, vacation or whatever, and have it autofill if the cell is left blank, using vba. this is what i have so far, and it is working I was just wondering if it was possible to set it up for a range of cells instead of having to enter each one in manually.


    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    If Range("h1").Value <= 0 Then
    Range("h1") = Range("i1")
    End If
    
    If Range("h2").Value <= 0 Then
    Range("h2") = Range("i2")
    End If
    
    If Range("h3").Value <= 0 Then
    Range("h3") = Range("i3")
    End If
    
    End Sub
    example.zip
    Any and all help is greatly appreciated. Thanks.
    Last edited by jubangy; 05-17-2008 at 08:15 AM. Reason: Added Attachment

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1