ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Macro Question (https://www.excelbanter.com/excel-worksheet-functions/142863-macro-question.html)

Carl

Macro Question
 
I'm using this:

Sub Macro1()


Workbooks.Open Filename:="J:\Projects\MarketShare May 2007.xls"



'Trying to add code that will prompt me to select one of the worksheets
in the above workbook



Range("A7:I19").Select

Application.CutCopyMode = False

Selection.Copy

Windows("OCC_Top10.xls").Activate

Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _

False, Transpose:=False

Application.CutCopyMode = False



'Trying to add code that will email the current selection to
"





End Sub



Thank you in advance.

Gary''s Student

Macro Question
 
Sub demo()
Dim s As String
s = Application.InputBox("enter tab name:", 2)
Sheets(s).Activate
End Sub
--
Gary''s Student - gsnu200721

FSt1

Macro Question
 
hi,
1. try this...
Sub pickone()
Dim pko As String
pko = InputBox("enter a sheet name")
Sheets(pko).Select
End Sub
and it may just be me but clicking the tab seems easier.
2. see this site...
http://www.rondebruin.nl/sendmail.htm

regards
FSt1


"carl" wrote:

I'm using this:

Sub Macro1()


Workbooks.Open Filename:="J:\Projects\MarketShare May 2007.xls"



'Trying to add code that will prompt me to select one of the worksheets
in the above workbook



Range("A7:I19").Select

Application.CutCopyMode = False

Selection.Copy

Windows("OCC_Top10.xls").Activate

Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _

False, Transpose:=False

Application.CutCopyMode = False



'Trying to add code that will email the current selection to
"





End Sub



Thank you in advance.



All times are GMT +1. The time now is 05:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com