Need macro help
Closed
bbrown123
Posts
2
Registration date
Wednesday February 12, 2014
Status
Member
Last seen
February 14, 2014
-
Feb 12, 2014 at 12:01 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Feb 14, 2014 at 11:31 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Feb 14, 2014 at 11:31 PM
Related:
- Need macro help
- Spell number in excel without macro - Guide
- Macro excel download - Download - Spreadsheets
- Excel macro to create new sheet based on value in cells - Guide
- Run macro on opening workbook - Guide
- Excel vba assign macro to button programmatically - Guide
2 responses
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Feb 13, 2014 at 11:26 PM
Feb 13, 2014 at 11:26 PM
let us question by question.
for e.g
"I want to have a macro set up that allows users to click in a cell, type in data and that whatever was typed in creates a sheet named whatever was typed in that cell, and hide it from view. (will need to run this macro on sheet 2 through sheet 11).
"
open vb editor (alt F11)
hit control R
you see name of YOUR WORKBOOK
under the name click "thisworkbook"
a window opens
in that window copy this EVET CODE and the FUUNCTION.
save the file as macro enable. close and open and enable macros
I presume there are some names in column A of each of the sheets
select any name (you need not click anything)
see what happens.
.
for e.g
"I want to have a macro set up that allows users to click in a cell, type in data and that whatever was typed in creates a sheet named whatever was typed in that cell, and hide it from view. (will need to run this macro on sheet 2 through sheet 11).
"
open vb editor (alt F11)
hit control R
you see name of YOUR WORKBOOK
under the name click "thisworkbook"
a window opens
in that window copy this EVET CODE and the FUUNCTION.
save the file as macro enable. close and open and enable macros
I presume there are some names in column A of each of the sheets
select any name (you need not click anything)
see what happens.
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range)
Dim shname As String
Set Sh = ActiveSheet
If Target.Column <> 1 Then GoTo enableevents
Application.enableevents = False
shname = Target
If SheetExists(shname) Then GoTo enableevents
Worksheets.Add
ActiveSheet.Name = Target
ActiveSheet.Visible = xlSheetHidden
MsgBox "new sheet opened and hidden "
enableevents:
Application.enableevents = True
End Sub
Function SheetExists(SheetName As String) As Boolean
' returns TRUE if the sheet exists in the active workbook
SheetExists = False
On Error GoTo NoSuchSheet
If Len(Sheets(SheetName).Name) > 0 Then
SheetExists = True
Exit Function
End If
NoSuchSheet:
End Function
.
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Feb 14, 2014 at 11:31 PM
Feb 14, 2014 at 11:31 PM
your configuration of sheet may be different from what I envisaged. Tt worked in my sheet. SEND YOUR WORKBOOK (PRERERABLY)SMALL AMOUNT OF DATA) .
HOW?
clilck speedyshare.com
upload your file
they will give you a web address
email thAt address \
and AGAIN EXPLAIN WHAT YOU WANT.
HOW?
clilck speedyshare.com
upload your file
they will give you a web address
email thAt address \
and AGAIN EXPLAIN WHAT YOU WANT.
Feb 14, 2014 at 07:48 AM
I really need to be walked through this like I am a moron, because I truly do not know what I am doing lol.
Thank you so much for helping. I hope this works! What do I do now?