View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett[_2_] Don Guillett[_2_] is offline
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