View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
morry[_18_] morry[_18_] is offline
external usenet poster
 
Posts: 1
Default send value to a cell instead on MsgBox

I am using a countIf statement to count occurances of certain values
right now they are being displayed in a MsgBox but i want to have th
value pasted into a specific cell instead of the MsgBox. Below is th
code that I have so far. Can someone tell me the easiest way to mak
this change.
----------------------------------------------------------
Private Sub S350btn_Click()

Dim S350 As String
Dim Gate1 As String
Dim Gate2 As String
Dim Gate4 As String

S350 = "350"
Gate1 = "Gate 1"
Gate2 = "Gate 2"
Gate4 = "Gate 4"

MsgBox Application.CountIf(Range("B:B"), "*" & S350 & "*" & "*"
Gate1 & "*"), , "S350 Gate 1"

MsgBox Application.CountIf(Range("B:B"), "*" & S350 & "*" & "*"
Gate2 & "*"), , "S350 Gate 2"

MsgBox Application.CountIf(Range("B:B"), "*" & S350 & "*" & "*"
Gate4 & "*"), , "S350 Gate 4"

End Sub

--------------------------------------------------------------

Thank you

Morr

--
Message posted from http://www.ExcelForum.com