View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Michael A Michael A is offline
external usenet poster
 
Posts: 48
Default Help with Macro. -- User input for sheet name

Hi Norman,

I have tried that as well. I get the error

"invalid qualifer" on line : estuff.Activate

Im trying to activate that sheet.. im stuck. Any other suggestions? And
thanks for the response.

- Mike

"Norman Jones" wrote:

Hi Michael,

Try changing:

Dim estuff As Worksheet


to

Dim estuff As String


---
Regards,
Norman


"Michael A" wrote in message
...
Hello, could someone please help me with this. I cant seem to have it
activate the sheet based on the user input. Here is what I have. I can't
quite figure out how to get this to work right. Any help would be greatly
appreciated. Thanks!


Sub CopyStuff()



Dim estuff As Worksheet
Dim ThisSheet As String

ThisSheet = ActiveSheet.Name



estuff = InputBox("What date is this for? I.E 1,2,3 etc.")

Application.ScreenUpdating = False
Workbooks.Open Filename:= _
"\\network1\January.xls"

estuff.Activate

' Now working JanC

Workbooks("January Stats.xls").Worksheets(ThisSheet).Range("B37") =
Workbooks("January.xls").Worksheets(estuff).Range( "U2").Value
Workbooks("January Stats.xls").Worksheets(ThisSheet).Range("A41") =
Workbooks("January.xls").Worksheets(estuff).Range( "V2").Value
Workbooks("January Stats.xls").Worksheets(ThisSheet).Range("B41") =
Workbooks("January.xls").Worksheets(estuff).Range( "W2").Value

ActiveWorkbook.Close False
Application.ScreenUpdating = True
End Sub