View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
gavmer[_77_] gavmer[_77_] is offline
external usenet poster
 
Posts: 1
Default User form upon opening


Hi all, me again!

The code below copies and pastes columns dependant on value in comb
box. What i am after is for this to appear on maybe a user form whe
the user opens the workbook so that the process can be applied onl
once. Can anyone assist??

Cheers!!!!

Private Sub ComboBox1_Change()
Dim myVal As String
Dim fRng As Range
Dim tRng As Range
Set fRng = Nothing
Set tRng = Worksheets("inclusions").Range("g1")
myVal = Worksheets("inclusions").ComboBox1.Value
Select Case myVal
Case Is = "MAN Roland R202"
Set fRng = Worksheets("pricing").Range("e1")
Case Is = "MAN Roland R204"
Set fRng = Worksheets("pricing").Range("f1")
Case Is = "MAN Roland R205"
Set fRng = Worksheets("pricing").Range("g1")
Case Is = "Clear"
Set fRng = Worksheets("pricing").Range("h1")
Case Else
End Select
If fRng Is Nothing Then
Else
tmp = MsgBox("Note, you are now changing you machine configuration an
pricing!", vbOK)
fRng.EntireColumn.Copy _
Destination:=tRng
End If
End Su

--
gavme
-----------------------------------------------------------------------
gavmer's Profile: http://www.excelforum.com/member.php...nfo&userid=666
View this thread: http://www.excelforum.com/showthread.php?threadid=26225