Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Location: Melbourne
Posts: 5
Default Create new sheet based on cell value

I have a sheet which uses query table to download several different tables of stock data onto a temporary sheet "Raw Data" based on input stock code on main "sheet1".

Basically I need a code to create a new sheet with the name of the stock code from "sheet1".

However, I want it to search through all the existing sheets, and if that sheet exists already (i.e has been searched previously) then I want that to become the active sheet. I will then append the data to the end of existing data on that sheet.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Create new sheet based on cell value

On Thursday, July 5, 2012 5:23:39 AM UTC-5, Chulius Caesar wrote:
I have a sheet which uses query table to download several different
tables of stock data onto a temporary sheet "Raw Data" based on input
stock code on main "sheet1".

Basically I need a code to create a new sheet with the name of the stock
code from "sheet1".

However, I want it to search through all the existing sheets, and if
that sheet exists already (i.e has been searched previously) then I want
that to become the active sheet. I will then append the data to the end
of existing data on that sheet.




--
Chulius Caesar


You can use something like this. If desired send your file to ME.

Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(ActiveCell.Value) Is Nothing Then
MsgBox "Worksheet " & WantedSheet & " was not found, use RClick on " _
& "Sheet Tab Navigation arrow in lower left corner " _
& "to find desired sheetname."
Else
Sheets(ActiveCell.Value).Select
End If

  #3   Report Post  
Junior Member
 
Location: Melbourne
Posts: 5
Default

Quote:
Originally Posted by Don Guillett[_2_] View Post
On Thursday, July 5, 2012 5:23:39 AM UTC-5, Chulius Caesar wrote:
I have a sheet which uses query table to download several different
tables of stock data onto a temporary sheet "Raw Data" based on input
stock code on main "sheet1".

Basically I need a code to create a new sheet with the name of the stock
code from "sheet1".

However, I want it to search through all the existing sheets, and if
that sheet exists already (i.e has been searched previously) then I want
that to become the active sheet. I will then append the data to the end
of existing data on that sheet.




--
Chulius Caesar


You can use something like this. If desired send your file to ME.

Dim WantedSheet As String
WantedSheet = Trim(ActiveCell.Value)
If WantedSheet = "" Then Exit Sub
On Error Resume Next
If Sheets(ActiveCell.Value) Is Nothing Then
MsgBox "Worksheet " & WantedSheet & " was not found, use RClick on " _
& "Sheet Tab Navigation arrow in lower left corner " _
& "to find desired sheetname."
Else
Sheets(ActiveCell.Value).Select
End If
Thanks, worked a treat
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
Create New Sheets and Name Them Based on Values in another sheet KennyD Excel Discussion (Misc queries) 2 January 28th 10 06:51 PM
create sheet based on value in string J.W. Aldridge Excel Programming 2 April 24th 09 07:59 PM
Create new sheets based off Data sheet, and template sheet Midget Excel Programming 2 May 1st 07 09:55 PM
Create Cell Comment based on text in a cell on another worksheet Dave Fellman Excel Discussion (Misc queries) 2 March 15th 07 09:49 AM
Create summary based on specifc value in a different sheet RayYeung Excel Worksheet Functions 0 July 19th 05 05:39 AM


All times are GMT +1. The time now is 04:34 PM.

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

About Us

"It's about Microsoft Excel"