Results 1 to 3 of 3

Auto run the Code automaticaly when cell is updated

Threaded View

  1. #1
    Registered User
    Join Date
    12-04-2013
    Location
    Melbourne
    MS-Off Ver
    Excel 2007
    Posts
    92

    Auto run the Code automaticaly when cell is updated

    Hi,

    I want to run this code automaticaly when value of E32 is changed. E32 is not manualy entered it is =H15. H15 is sum of some values.


    This is the function I have. I tried using Worksheet_Change(ByVal Target As Range) but it didnt work. I may have done it wrong. Any help would be great. Thankyou !



    Sub change()
    
    Dim Bandwidth As Integer, Access_Type As String, Access_Bandwidth As String
    
    
    Bandwidth = Sheets("Bandwidth_REQ").Range("E32").Value
    
    If Bandwidth <= 460.8 Then
    Access_Type = "BDSL"
    Access_Bandwidth = "512k/512k"
    
    Sheets("Bandwidth_REQ").Range("D33").Value = Access_Type
    Sheets("Bandwidth_REQ").Range("E33").Value = Access_Bandwidth
    
    End If
    
    If Bandwidth <= 900 And Bandwidth > 460.8 Then
    Access_Type = "BDSL"
    Access_Bandwidth = "1M/1M"
    
    Sheets("Bandwidth_REQ").Range("D33").Value = Access_Type
    Sheets("Bandwidth_REQ").Range("E33").Value = Access_Bandwidth
    
    End If
    
    If Bandwidth <= 1350 And Bandwidth > 900 Then
    Access_Type = "BDSL"
    Access_Bandwidth = "1.5M/1.5M"
    
    Sheets("Bandwidth_REQ").Range("D33").Value = Access_Type
    Sheets("Bandwidth_REQ").Range("E33").Value = Access_Bandwidth
    
    End If
    
    
    If Bandwidth <= 1800 And Bandwidth > 1350 Then
    Access_Type = "BDSL"
    Access_Bandwidth = "2M/2M"
    
    Sheets("Bandwidth_REQ").Range("D33").Value = Access_Type
    Sheets("Bandwidth_REQ").Range("E33").Value = Access_Bandwidth
    
    End If
    
    
    If Bandwidth <= 3600 And Bandwidth > 1800 Then
    Access_Type = "BDSL"
    Access_Bandwidth = "4M/4M"
    
    Sheets("Bandwidth_REQ").Range("D33").Value = Access_Type
    Sheets("Bandwidth_REQ").Range("E33").Value = Access_Bandwidth
    
    End If
    
    
    If Bandwidth <= 5400 And Bandwidth > 3600 Then
    Access_Type = "BDSL"
    Access_Bandwidth = "6M/6M"
    
    Sheets("Bandwidth_REQ").Range("D33").Value = Access_Type
    Sheets("Bandwidth_REQ").Range("E33").Value = Access_Bandwidth
    
    End If
    
    
    If Bandwidth <= 7200 And Bandwidth > 5400 Then
    Access_Type = "BDSL"
    Access_Bandwidth = "8M/8M"
    
    Sheets("Bandwidth_REQ").Range("D33").Value = Access_Type
    Sheets("Bandwidth_REQ").Range("E33").Value = Access_Bandwidth
    
    End If
    
    
    If Bandwidth <= 1350 And Bandwidth > 900 Then
    Access_Type = "BDSL"
    Access_Bandwidth = "10M/10M"
    
    Sheets("Bandwidth_REQ").Range("D33").Value = Access_Type
    Sheets("Bandwidth_REQ").Range("E33").Value = Access_Bandwidth
    
    End If
    
    End Sub
    Last edited by alansidman; 12-15-2013 at 11:54 PM. Reason: code tags added.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] "Capturing' Cell data before it is auto updated.
    By hammer2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-08-2013, 07:21 PM
  2. "Capturing' Cell data before it is auto updated.
    By hammer2 in forum Excel General
    Replies: 1
    Last Post: 12-05-2013, 08:56 PM
  3. Auto sort when updated
    By IsiEMT in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 07-26-2011, 02:00 PM
  4. Rev. Auto Updated when sheet is updated and or entire book
    By frankee_gee in forum Excel General
    Replies: 1
    Last Post: 04-07-2008, 05:05 PM
  5. Replies: 2
    Last Post: 12-28-2006, 02:58 PM

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