Results 1 to 3 of 3

Passing Variable through (radio) OptionButton(s) [Excel 2010/14 VBA Only)

Threaded View

  1. #1
    Forum Contributor
    Join Date
    03-22-2012
    Location
    OR, USA
    MS-Off Ver
    Excel 14/2010
    Posts
    273

    Passing Variable through (radio) OptionButton(s) [Excel 2010/14 VBA Only)

    I am having trouble with code contained in the attached sheet. It works fine for this but when I integrated it into another sheet it isn't working. I need to pass the selection from the OptionButton(s) to use in the following code.

                
                valid = False
                Do Until valid = True
                drg = Application.InputBox(prompt:="Enter the DRG", Title:="DRG", Left:=300, Top:=250, Type:=1)
                If drg <> Empty And drg <> "False" Then
                        valid = True
                End If
                Loop
                
                Select Case disch_date
                    Case 39722 To 39993
                        Set drgFound = drg_range.Find(drg, , , xlWhole)
                        If drgFound Is Nothing Then
                            cwDRG = Application.VLookup(drg, cw_Range, 2, False)
                            cwDRG_descrip = Application.VLookup(cwDRG, drg_range, 2, False)
                            cwBln = True
                        Else
                            Set msdrgFound = msdrg_range.Find(drg, , , xlWhole)
                            If msdrgFound Is Nothing Then
                                cwDRG = drg
                                cwDRG_descrip = Application.VLookup(drg, drg_range, 2, False)
                                cwBln = False
                            Else
                                msdrg = drg
                                msdrg_descrip = Application.VLookup(msdrg, msdrg_range, 2, False)
                                drg_descrip = Application.VLookup(drg, drg_range, 2, False)
                            
                                Set drg_select = New drg_select
                                With drg_select
                                    .Show
                                End With
                            End If
                        End If
                        
                        Select Case cwBln
                            Case True
                            MsgBox ("Crosswalked MS-DRG is: " & cwDRG & "." _
                            & vbCrLf & cwDRG_descrip)
                            
                            Case False
                            MsgBox ("DRG is: " & cwDRG & "." _
                            & vbCrLf & cwDRG_descrip)
                        End Select
                        
                        drg = cwDRG
                        
                    Case Else
                End Select
    
    inp_form.Range("F14").Value = drg
                If trauma = "YES" And admit_type = "5" Then
                    'set trauma dynamic DRG range
                    Set arrayrange = ActiveWorkbook.Sheets("ARRAYS").Range("A1:E" & ActiveWorkbook.Sheets("ARRAYS").Cells(Rows.Count, "A").End(xlUp).Row + 1)
                    services = "TRAUMA"
                    conc = dyear & services & geozip
                    lkuprange = Application.VLookup(conc, arrayrange, 5, False)
                    Set trange = ActiveWorkbook.Sheets("08FSDATA").Range(lkuprange)
                    drg_value = Application.VLookup(drg, trange, 3, False)
                    drg_descrip = Application.VLookup(drg, trange, 2, False)                
    inp_form.Range("E15").Value = drg_descrip
                Else
                    'set standard dynamic DRG range
                    Set arrayrange = ActiveWorkbook.Sheets("ARRAYS").Range("A1:E" & ActiveWorkbook.Sheets("ARRAYS").Cells(Rows.Count, "A").End(xlUp).Row + 1)
                    services = "STANDARD"
                    conc = dyear & services & geozip
                    lkuprange = Application.VLookup(conc, arrayrange, 5, False)
                    Set trange = ActiveWorkbook.Sheets("08FSDATA").Range(lkuprange)
                    drg_value = Application.VLookup(drg, trange, 3, False)
                    drg_descrip = Application.VLookup(drg, trange, 2, False)                
    inp_form.Range("E15").Value = drg_descrip
                End If
    Last edited by lloydgodin; 11-29-2012 at 05:10 PM. Reason: Add Software/Version & Current Cdoe

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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