View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JuanMarin JuanMarin is offline
external usenet poster
 
Posts: 6
Default How do I display the result of a function on seperate worksheete.

You could try the following:

---------------------------------------------
Sub FixedDate()
Dim WS As Worksheet
Dim Y As Double
Dim m As Double
Dim Sname As String
Dim Celda As Range

Set Celda = Application.InputBox(prompt:="Current month's count",
Type:=8)
Y = Year(Date)
m = month(Date)

Sname = Str(m) & "-" & Str(Y)

For i = 1 To ActiveWorkbook.Sheets.Count
If ActiveWorkbook.Sheets(i).Name = Sname Then
MsgBox "there's already a worksheet for this month"
Exit Sub
End If
Next i

Set WS = Worksheets.Add
WS.Name = Sname
WS.Cells(1, 1) = Celda.Value

End Sub
----------------------------

it prompts you for the cell that's holding the count, then creates a
new worksheet named "month - year" and writes the count on cell A1. It
doesn't do much erro trapping but it should work. Hope this helps,

Juan M