Hi

I've been trying to make a currency converter, but I can't get it to function correctly!?

What I have is;
VB Code:
  1. Private Sub CommandButton1_Click()
  2. Dim x As Long
  3. Dim i As Long
  4. Dim j As Long
  5. Dim vSheet As Worksheet
  6. Dim dSheet As Worksheet
  7. Dim sSheet As Worksheet
  8. Dim oOption As MSForms.Control
  9.  
  10. Set vSheet = ActiveWorkbook.Worksheets("Valuta")
  11. Set dSheet = ActiveWorkbook.Worksheets("Data")
  12. Set sSheet = ActiveWorkbook.Worksheets("Start")
  13.  
  14. Application.ScreenUpdating = False
  15.  
  16. For Each oOption In Me.Frame1.Controls
  17.   If TypeName(oOption) = Left(oOption.Caption, 3) = "opt" Then
  18.     With oOption
  19.         If .Value = True Then
  20.             For x = 2 To 6
  21.                 If .Caption = vSheet.Cells(x, 1).Value Then
  22.                 With vSheet
  23.                     For i = 6 To dSheet.Cells(1, 5).End(xlToRight).Column
  24.                     If Not Right(.Cells(1, i).Value, 3) = "pct" Then
  25.                                 vSheet.Activate
  26.                                 vSheet.Cells(x, 2).Copy
  27.                                 dSheet.Activate
  28.                                 dSheet.Range(Cells(2, i), Cells(2, i).End(xlDown)).PasteSpecial Paste:=xlValues, operation:=xlMultiply
  29.                                
  30.                     End If
  31.                     Next i
  32.                 End With
  33.                 End If
  34.             Next x
  35.         End If
  36.     End With
  37.   End If
  38. Next oOption
  39.  
  40. For Each oOption In Me.Frame2.Controls
  41.   If TypeName(oOption) = Left(oOption.Caption, 3) = "opt" Then
  42.     With oOption
  43.         If .Value = True Then
  44.             For x = 2 To 6
  45.                 If .Caption = vSheet.Cells(x, 1).Value Then
  46.                 With vSheet
  47.                     For i = 6 To dSheet.Cells(1, 5).End(xlToRight).Column
  48.                     If Not Right(.Cells(1, i).Value, 3) = "pct" Then
  49.                                 vSheet.Activate
  50.                                 vSheet.Cells(x, 2).Copy
  51.                                 dSheet.Activate
  52.                                 dSheet.Range(Cells(2, i), Cells(2, i).End(xlDown)).PasteSpecial Paste:=xlValues, operation:=xlDivide
  53.                                 sSheet.Cells(27, 7).Value = oOption.Caption
  54.                     End If
  55.                     Next i
  56.                 End With
  57.                 End If
  58.             Next x
  59.         End If
  60.     End With
  61.   End If
  62. Next oOption
  63.  
  64. FrmCur.Hide
  65.  
  66. Application.ScreenUpdating = True
  67.  
  68. End Sub

I don't get any errors - but it doesn't do anything either! in other words - its useless!!

Any ideas??