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:
Private Sub CommandButton1_Click() Dim x As Long Dim i As Long Dim j As Long Dim vSheet As Worksheet Dim dSheet As Worksheet Dim sSheet As Worksheet Dim oOption As MSForms.Control Set vSheet = ActiveWorkbook.Worksheets("Valuta") Set dSheet = ActiveWorkbook.Worksheets("Data") Set sSheet = ActiveWorkbook.Worksheets("Start") Application.ScreenUpdating = False For Each oOption In Me.Frame1.Controls If TypeName(oOption) = Left(oOption.Caption, 3) = "opt" Then With oOption If .Value = True Then For x = 2 To 6 If .Caption = vSheet.Cells(x, 1).Value Then With vSheet For i = 6 To dSheet.Cells(1, 5).End(xlToRight).Column If Not Right(.Cells(1, i).Value, 3) = "pct" Then vSheet.Activate vSheet.Cells(x, 2).Copy dSheet.Activate dSheet.Range(Cells(2, i), Cells(2, i).End(xlDown)).PasteSpecial Paste:=xlValues, operation:=xlMultiply End If Next i End With End If Next x End If End With End If Next oOption For Each oOption In Me.Frame2.Controls If TypeName(oOption) = Left(oOption.Caption, 3) = "opt" Then With oOption If .Value = True Then For x = 2 To 6 If .Caption = vSheet.Cells(x, 1).Value Then With vSheet For i = 6 To dSheet.Cells(1, 5).End(xlToRight).Column If Not Right(.Cells(1, i).Value, 3) = "pct" Then vSheet.Activate vSheet.Cells(x, 2).Copy dSheet.Activate dSheet.Range(Cells(2, i), Cells(2, i).End(xlDown)).PasteSpecial Paste:=xlValues, operation:=xlDivide sSheet.Cells(27, 7).Value = oOption.Caption End If Next i End With End If Next x End If End With End If Next oOption FrmCur.Hide Application.ScreenUpdating = True End Sub
I don't get any errors - but it doesn't do anything either! in other words - its useless!!
Any ideas??




Reply With Quote