Results 1 to 7 of 7

Recursive division Macro Mod needed for Char Type

Threaded View

zeph2323 Recursive division Macro Mod... 11-11-2008, 02:24 PM
VBA Noob zeph2323, Please read... 11-11-2008, 04:00 PM
zeph2323 Hello, Thanks for the... 11-11-2008, 05:38 PM
VBA Noob Go to first post > click edit... 11-11-2008, 05:48 PM
zeph2323 Hello, Thanks for all... 11-11-2008, 06:22 PM
VBA Noob Think this works Sub... 11-11-2008, 06:42 PM
zeph2323 Thank you!!! works Perfect =)... 11-12-2008, 10:21 AM
  1. #1
    Registered User
    Join Date
    07-11-2008
    Location
    peru
    Posts
    27

    Recursive division Macro Mod needed for Char Type

    Hello,

    I need a slight mod to the below code which works perfectly otherwise. What it does is it divides whatever is in column K by 30 and puts in its relative cell in column M( There a bunch of mini tables below each other with blank rows in between). The thing is sometimes there are characters in column K like "N/A" for instance and the macro crashes since its only designed to take into account numerical and blank cells in column K. Any help in tweaking the below code is much appreciated..



    Sub InsertFormulas()
    Dim Wks As Worksheet
    Dim rngRolls As Range, Cell As Range
    Dim lngRow As Long
    
    Application.ScreenUpdating = False
    
    For Each Wks In ThisWorkbook.Worksheets
    lngRow = Wks.Range("K" & Rows.Count).End(xlUp).Row
    Set rngRolls = Wks.Range("M6:M" & lngRow)
    
    For Each Cell In rngRolls
    If Not IsEmpty(Cell.Offset(0, -2)) And Not Cell = "Rolls" And _
    (IsEmpty(Cell) Or IsNumeric(Cell)) Then _
    Cell = Cell.Offset(0, -2) / 30
    Next Cell
    
    Next Wks
    
    Application.ScreenUpdating = True
    End Sub
    Last edited by zeph2323; 11-12-2008 at 10:22 AM.

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