Results 1 to 2 of 2

Thread: Please help with Multiple Subs

  1. #1

    Please help with Multiple Subs



    Register for a FREE account, and/
    or Log in to avoid these ads!

    Hi. I'm pretty good on excel, but know nothing about VBA, so I'm trying to learn as I go (use it at work), but cannot fathom this out. I have the following sub on a document:
    Code:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim Cell As Range
    For Each Cell In Range("F8,F10")
    Cell.Value = Application.RoundUp(Cell.Value, -1)
    Next
    End Sub
    I need to add something to it that I know works on it's own, but can't seem to work out how to add it when the existing sub is there: (I've taken out the text for the msgbox as it's for work).

    If Range("B2").Value > 400000 And Range("B3").Value > 0.8 Then
    MsgBox "text"

    Can anyone offer a solution? I'm sure this is really easy, but like I said, I have no formal knowledge of VBA.

    Thanks to whoever fixes this for me
    Last edited by JoePublic; 2013-11-13 at 09:05 AM. Reason: Add code tags

  2. #2
    Super Moderator p45cal's Avatar
    Join Date
    Dec 2012
    Posts
    1,356
    Articles
    0
    Excel Version
    365
    Code:
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    Dim Cell As Range
    For Each Cell In Range("F8,F10")
      Cell.Value = Application.RoundUp(Cell.Value, -1)
    Next
    If Range("B2").Value > 400000 And Range("B3").Value > 0.8 Then MsgBox "text"
    End Sub
    ?

Posting Permissions

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