Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with Promting for wooksheet name in macro.

I'm trying to get the macro to let me pick the name on the worksheet t
paste the info into. Here's what i have but it gives me an error
(run-time error '9' subscript out of range)

Help a newbie please! :)


Windows("CUP_Results.xls").Activate
Sheets("Pro Calc").Select
Range("A1:AF100").Select
Selection.Copy
Sheets(strWorksheet = InputBox("Please enter the name of th
worksheet")).Select
ActiveSheet.Past

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Help with Promting for wooksheet name in macro.

Hi
not tested but try:
Dim target_name

Windows("CUP_Results.xls").Activate
target_name = InputBox("Please enter the name of theworksheet")
Sheets("Pro Calc").Range("A1:AF100").copy
Sheets(target_name).paste


--
Regards
Frank Kabel
Frankfurt, Germany


I'm trying to get the macro to let me pick the name on the worksheet
to paste the info into. Here's what i have but it gives me an error.
(run-time error '9' subscript out of range)

Help a newbie please! :)


Windows("CUP_Results.xls").Activate
Sheets("Pro Calc").Select
Range("A1:AF100").Select
Selection.Copy
Sheets(strWorksheet = InputBox("Please enter the name of the
worksheet")).Select
ActiveSheet.Paste


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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Help with Promting for wooksheet name in macro.

Change

Sheets(strWorksheet = InputBox("Please enter the name of the
worksheet")).Select

to

sSheet = InputBox("Please enter the name of the worksheet")
if sSheet < "" Then
Sheets(sSHeet).Select
End If


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Leatherfoot " wrote in message
...
I'm trying to get the macro to let me pick the name on the worksheet to
paste the info into. Here's what i have but it gives me an error.
(run-time error '9' subscript out of range)

Help a newbie please! :)


Windows("CUP_Results.xls").Activate
Sheets("Pro Calc").Select
Range("A1:AF100").Select
Selection.Copy
Sheets(strWorksheet = InputBox("Please enter the name of the
worksheet")).Select
ActiveSheet.Paste


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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with Promting for wooksheet name in macro.

Thanks so much guys... I copied your suggestion into the macro Bob and
it worked perfectly. :)


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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Promting Text? Neil Pearce Excel Discussion (Misc queries) 1 August 28th 09 02:49 PM
excel wooksheet problem rocket Excel Discussion (Misc queries) 1 January 16th 09 04:11 PM
promting a number in cell maccarone Excel Discussion (Misc queries) 2 December 18th 06 12:31 PM
how do I print gridlines for Excel wooksheet AdrianneH Excel Discussion (Misc queries) 2 September 7th 06 08:58 PM
How do I build a Macro that can identify wooksheet names peter147 Excel Discussion (Misc queries) 4 May 22nd 05 04:26 PM


All times are GMT +1. The time now is 08:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"