Thread: My code fails
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
kirkm[_6_] kirkm[_6_] is offline
external usenet poster
 
Posts: 156
Default My code fails


Hi,

I'm attemptng the following, to put mVal into any mCell in mSheet


Sub test(mSheet, mVal, mCell)
Dim wk As Workbook
Set wk = ActiveWorkbook
Dim sht As Worksheet
Set sht = wk.Worksheets(mSheet)

With sht
Range(mCell).Select
ActiveCell.Value = mVal
End With
Set sht = Nothing
Set wk = Nothing
End Sub



It doesn't work, but also doesn't report any errors.

It there anything obviously wrong with it?


Thanks - Kirk