Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 304
Default radio button with VB code

Thanks, this is what I did and what I need it for, but it did not work like I
want it to. It does not bring up the "Call" VB codes. Could you take a look
at it for me and point out what I'm doing wrong? Thanks

Sheets("INPUT_A").Select
If OptionButton2 Then
Call AR_GTD
ElseIf OptionButton3 Then
Call AR_Both
ElseIf OptionButton4 Then
Call AR_ECO
End If

It should run one the following:
Sub AR_GTD()

Sheets("AR").Select
Rows("17:20,35:38,53:56,78:81,102:105,140:147,160: 167,181:187").Select
Selection.Delete Shift:=xlUp
Range("A1").Select
End Sub


Sub AR_ECO()

Sheets("AR").Select
Range("7:8,25:26,43:44,68:69,92:93,136:137,156:157 ,176:177").Select
Selection.Delete Shift:=xlUp
Range("A1").Select
End Sub


Sub AR_Both()

Sheets("AR").Select
Range(
"7:8,17:20,25:26,35:38,43:44,53:56,68:69,78:81,92: 93,102:105,136:137,140:147,160:163,164:167,176:177 ,180:187,156:157" _
).Select
Selection.Delete Shift:=xlUp
Range("A1").Select
End Sub

And this is what the whole code is:

Sub Copy_Paste_AR()
'
Application.ScreenUpdating = False

Sheets("AR").Visible = True

Dim MyPath As String
Dim MyFileName As String

Sheets("AR").Select
Range("H1:H187", Range("H1:H187").End(xlDown)).Copy
Range("H1").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False

Columns("A:G").Delete Shift:=xlToLeft

Sheets("INPUT_A").Select

If OptionButton2 Then
Call AR_GTD
ElseIf OptionButton3 Then
Call AR_Both
ElseIf OptionButton4 Then
Call AR_ECO
End If

Sheets("AR").Select

MyPath = "S:\SUPPORT\CADTAR\CMS\!Exported_Text_Files!\"
MyFileName = "d" & Sheets("INPUT_A").Range("C8").Value & "ar"

ActiveWorkbook.SaveAs Filename:=MyPath & MyFileName, _
FileFormat:=xlText, CreateBackup:=False

Sheets("INPUT_A").Select
MsgBox ("AR file has been created at:" & vbLf &
"S:\SUPPORT\CADTAR\CMS\!Exported_Text_Files!\" )

End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reset button code for Radio Buttons [email protected] Excel Discussion (Misc queries) 6 August 25th 12 03:09 PM
Help with radio button Diana Excel Discussion (Misc queries) 1 July 17th 06 09:29 PM
"RADIO BUTTON" Ian Shere Excel Discussion (Misc queries) 1 July 4th 05 10:59 PM
How do I lock a radio button group if a N/A button is selected worry a lot Excel Discussion (Misc queries) 2 May 21st 05 08:33 PM
VBA: Disable Frame and Radio Buttons based on Another Radio Button Being True Mcasteel Excel Worksheet Functions 2 October 29th 04 07:06 PM


All times are GMT +1. The time now is 07:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"