Results 1 to 2 of 2

Thread: over flow error
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular
    Join Date
    Oct 2007
    Posts
    737
    Post Thanks / Like
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Default over flow error

    I have this code that encounters an error as a result of trying to divide by zero. How can I avoid this error?

    Code:
    Range("P2") / WorksheetFunction.Subtotal(9, Range("U18:U18" & Range("U" & Rows.Count).End(xlUp).Row))
    The trick with sneaky users is not teaching them anything lest they get wise!

  2. #2
    Board Regular
    Join Date
    Mar 2015
    Location
    Syria
    Posts
    256
    Post Thanks / Like
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Default Re: over flow error

    Hi
    try
    Code:
     Range("a1") = ActiveSheet.Range("P2") / WorksheetFunction.Subtotal(9, Range("U18:U" & Rows.Count).End(xlUp).Rows)
    Last edited by mohadin; Aug 23rd, 2019 at 04:43 AM.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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