VBA To Create New Sheet ...
I would like to be able to have a macro, linked to a button, so that when you press that button it creates a new named sheet based on data in a particular cell.
I.e. There is a table with the following data:
Apples (A1)
Oranges (A2)
Pears (A3)
There are also the sheets Apples, Oranges & Pears.
You enter 'Grape' in cell A4, then when you press the button it creates a new sheet named Grape.
Also when a new sheet is created, the 'input cell', in this case A4, is moved down one so that when the next sheet is needed to be added, it doesn't just add the same sheet (i.e. in the example above, we don't end up with a new sheet named 'Grape' each time we click the button).
View Complete Thread with Replies
Sponsored Links:
Related Forum Messages:
Can VBA Create A Named Sheet In One Step?
My vb code currently creates a new sheet via "Sheets.add". This new sheet has the default name of "sheet1" which I rename as "tempSheet". I then populate tempSheet with data, save as a CVS file and then I remove tempSheet. If I stay in my workbook and try to execute the code again, the default name of the sheet it now creates is "sheet2" and not "sheet1" - this is a problem becuase my code is trying to rename "sheet1" "tempSheet" and of course it cant.
View Replies!
View Related
Copy Sheet & Create New Monthly Sheet From Present Sheet
I want to create a macro button that can create copy, insert, paste and rename the new sheet in next month's name, like if the active sheet's name is January, I want to copy the whole sheet of January, insert new sheet, paste the new sheet and rename the new sheet to next month like February? Also rename the new sheet (February) cell B3 the same as new sheet's name (February) So if month of February is near end, the macro button in February will create the same way as Jan did which means the next sheet will be named March and so on.
View Replies!
View Related
Automatically Re-name Sheet To Cell Value & Create Copy Of Hidden Sheet
I have a workbook with a hidden sheet ("Template") and a visible sheet("New Job"). I need code so when cell F1 in "New Job" is populated: 1-the sheet is renamed to the value of F1, 2-a new tab is made (a carbon copy of the hidden sheet "Template") 3-the new tab is named "New Tab" and marked as unhidden. Public Sub Worksheet_Change(ByVal Target As Range) ActiveSheet.Name = Range("F1").Value End Sub Function WorksheetExists(SheetName As String, _ Optional WhichBook As Workbook) As Boolean Dim WB As Workbook Set WB = IIf(WhichBook Is Nothing, ThisWorkbook, WhichBook) On Error Resume Next WorksheetExists = CBool(Len(WB.Worksheets(SheetName).Name) > 0) End Function..................
View Replies!
View Related
Create New Sheet For Each Row Of Another Sheet Auto Populate Data.
i have a sheet called 'sample database'. it consists of 56 columns, each with a specific title in row 1. i.e. name, surname, mobile_number, and so on. from row 2 onwards the data has been populated for roughly 200 rows. i have another 'Capture Sheet' which has the same titles as 'Sample database' except it's in a different format. its a printable form that is given to new employees when they start. once they have completed it it gets captured into the 'Sample Database' sheet. my wifes boss now wants 1 new sheet for each row in the 'sample database' sheet based on the format/layout of the 'capture form'. how can i get the 'capture form' to auto populate the data from the 'sample database' sheet and create a new sheet for each row? i know this is possible i just dont know how to do it.
View Replies!
View Related
Macro Pull Data From Each Sheet And Create A Summary Sheet
I need to create a macro that will scan a spreadsheet for the number of sheets and then pull data from the same places on each sheet in order to create a summary sheet. Let me try to explain a little better. The spreadsheet I'm working with has a separate sheet for each new deal our company makes. Each of these sheets is in the same format - we use a template and fill in the data based on that whenever a new deal emerges. The sheets contain basic info about the deal in the first few rows and columns, then some narratives with dates describing the progress of the deal, and then a list of issues and whether or not they have been resolved. The problem is, each of these sheets contains too much info for a quick, high-level overview with the bosses so they've asked me to create something that will pull the basic info, the most recent narrative, and any unresolved issues from each sheet. This way, each time there's an overview scheduled with the bosses, the macro can be run and it will create a new sheet with data from each sheet in the workbook.
View Replies!
View Related
Create Sheet If Sheet Doesn't Exist
I need to be able to check if a certain worksheet exists in the active workbook. If that worksheet does not exist I need to make it. I already have the code for creating a new worksheet but I'm not sure how to check if the worksheet already exists.
View Replies!
View Related
Using VBA To Create VBA Code On The Fly
I have a vba module that reads a value from a txt file and saves that value in a variable called "iniInfo". I want to permanently assign that value programatically by using VBA code to create a Public variable e.g. "PUBLIC CONST conFIg = iniInfo" in my modGlobalVar Module. (Of course, this would only create the code if the "conFig" variable doesn't already exist.)
View Replies!
View Related
Create New Sheet From Template Sheet
I am using a code to create a new sheet using a click button, and currently have a template file that is being used. Private Sub cmdNewSheet_Click() Sheets.Add Before:=Sheets("Finish"), Type:="C:Documents and SettingsAdministratorMy Documents Stock ControlStockTemplate1.xlt" Sheets(Sheets.Count - 1). Name = txtNewSheet.Text txtNewSheet.Text = "" End Sub What i want to do is use a sheet in the workbook as a template. The sheet i want to use is simply called 'Temp', and the workbook i am working in is called Stock1.xls. Is this possible? I have had a look at past threads, but cannot find anything that points me in the right direction.
View Replies!
View Related
Create Summary Sheet
I have a sheet in my workbook named Summary, from this I would like to run a macro that cycles through every sheet except "Summary" & "Variables" & "Cash" and puts the sheet name in E5:down and cell AH30 from every sheet in F5:down. I know it's possible, but I'm not sure how to set up the loop.
View Replies!
View Related
Use A Button To Create New Sheet?
Is it possible to create a button in or out of a cell and when that is clicked it will generate a new sheet in the same workbook. Now this is throwing the line to you clever people... Having then created a new sheet can it be that in say A:1 it will display the date the sheet was created AND make a popup box appear to allow the user to enter a name for the new sheet?
View Replies!
View Related
Macro To Create New Sheet
I want to create a Macro that will create a new worksheet when the user so desires using a message box. The workbook contains 4 tabs, for example, named as follows: (1) template (2) 250 (3) 825 and (4) 975. I want the marco to work as follows: 1- Macro will ask user "please type store number" 2- Macro will then make of copy of "template" and create the new sheet 3- if user types in "860", I want to the macro to name the new sheet "860" and place the new worksheet between sheets 825 and 975. Also - this may be asking too much but is it also possible to also prevent user from entering non-valid numbers? The valid numbers are 001 - 999. ie; if user enters "1500", return message "invalid entry".
View Replies!
View Related
To Create Tracker Sheet
in creating a macro to automatically have the start time and end time recorded in a cell of the same workbook after opening and closing the excel workbook. Also, is there any way were we can also record the time if the system has been locked while going for a break.
View Replies!
View Related
Create New Sheet At Each Change In Value
The routes are listed in column C, and other customer information is in columns A, B, and D to I. I have several workbooks, and in each workbook I need to have a different sheet for each Route. Right now, all the information is on one sheet. Is there a Macro or some VBA I can use that will make one sheet for each route? And move all the information with it?
View Replies!
View Related
Create A Summary Sheet ..
I have a spreadsheet which details an employee number, name, event type and no events as shown in attachment. (SHEET1). I would like to be able to create a summary sheet in the same workbook which will search through the list of usernames and produce a summary for each user.(SHEET2). The number of users varies in sheet1 so I would need to handle this dynamically.
View Replies!
View Related
Create A Summary Sheet
My brother created an invoice for his company using excel; it's s typical invoice: Name, Date, Invoice# Total, Tax, etc. He would like to have all of the mentioned information transfer to a summary sheet as he has between 30 and 60 per quarter. The problem is that they are not in a workbook. So each invoice is it's own .xls file. This can be time consuming if he had to open and copy from each sheet. Is there a way to copy the info to a summary sheet?
View Replies!
View Related
Create Graph Using VBA
I want to create excel graph using VBA and found difficulties on chart name set to default. the script is like this : ActiveSheet.ChartObjects("Chart 31").Activate Can I set my own name of the chart instead of "Chart 31" (excel default) ?
View Replies!
View Related
Create Tag In VBA?
I found this really cool code that creates a tag cloud in Excel using VBA. It's far too complex for my understanding but I was hoping I could get some of the experts opinions on here about modification possibilities. I have attached the macro-enabled 2007 workbook. What I am trying to do is search through a list of keywords and determine each keyword's density within a list. The list for example could look like this: slow windows xp windows xp running slow windows xp computer [slow windows xp] [windows xp running slow] [windows xp computer] [computer running slow windows xp] "computer running slow windows xp" "slow windows xp" "windows xp running slow" "windows xp computer" You'll notice the characters " [ ] of which I would like to ignore when the cloud builds. The cloud would list the most dense keywords first, and gradually decrease to the least dense keywords. The macro code is inside the workbook but I'll list it here to:
View Replies!
View Related
Create VBA InputBox
I am trying to create an inputbox using code from this site: Sub NumericDataType() Dim lNum As Long On Error Resume Next Application.DisplayAlerts = False lNum = Application.InputBox _ (Prompt:="Please enter you age.", _ Title:="HOW OLD ARE YOU", Type:=1) On Error Goto 0 Application.DisplayAlerts = True If lNum = 0 Then Exit Sub Else MsgBox "You are " & lNum & " years old." End If End Sub I get an error on the first line that says, "Compile error: argument not optional".
View Replies!
View Related
Macro To Create Sheet For Each In List
I have a list of client information on a worksheet. Every client is under a certain "Exp. Code". The team supports their clients by "Exp. Code". I would like to create a macro to segregate this data according to worker on different worksheets. Each worker supports multiple Exp.
View Replies!
View Related
Create Range To Inactive Sheet
I want to create ranges in a worksheet that is inactive.I have 3 sheets in the worksheet and i want, while the first sheet remains active, to create ranges in the second one. I'm using the following code that creates no errors no matter how i use it but it works only if the second sheet is active.
View Replies!
View Related
Saved Sheet To Create Hyperlink
I have a workbook for Purchase orders. how it works at the moment is when I fill in the Purchase prder sheet then save it, I have a macro that Copies Sheet "Purchase Order" creates a new sheet to paste it to then also copies some details to A Sheet called "Register. I would like to be able to (if possible) 1/ automaticly create a hyperlink between the P/o Nomber stored on the register as it is storing the new sheet & 2/ automaticly change the sheet tab to reflectthe P/order number in Cell G8 I have very little knowlage of VBA & am learning how to record macros so please be gentle. here is the macro I recorded ....
View Replies!
View Related
Create Meeting Schedule Sheet
I have three columns. the first column is a list of buyers (19), then second column is a list of suppliers (27) and the three column is the time. each supplier has ranked the buyers and the order they want to meet them. every meeting is for 20 minutes e.g 1st meeting at 8am then next at 820am. i can do all of it manually but the schedule becomes too long. is there a way to make the schedule in a way that it is easily readable by anyone and if I need to add anything, it should not be an issue.
View Replies!
View Related
How To Create Button On Excel Sheet
I have 1 sheet where in sheet 2 i have two type data and that is 1 level service data and 2 level service data. In sheet 1 i wanted 2 buttons that is 1 level service button and 2 level service button. and i wanted that if i will click on 1 level service button it iwll give me the 1 level service data from sheet 2.
View Replies!
View Related
Create Mileage Log From One Sheet To Another
I am trying to create a very simple mileage log that would get data from one sheet when I input it into another. (I attached the sheet). I have it set up so that it the formula is on bottom of sheet labeled store to store mileage but I would like to be able to track it easier on a different sheet called mileage log. So basically what I would like to do it put a formula in the mileage log so that I can just type in the store number in the to and from cells and have it populate it from the store to store mileage shet. I am an amateur. If it is easier I can just make another simple excel sheet that is on a seperate worksheet instead of using the mileage log.
View Replies!
View Related
Looking Up The Same Cell On Each Sheet To Create A Summary
I have 52 sheets in my workbook. Is there a simple way of creating a summary page of the data contained within specific cells which are the same reference on each sheet ? The slow way is to edit the Sheet reference in the formula, but I sense this is not the most elegant way to do it. Sheet 1 Cell A1 = 453 Sheet 2 Cell A1 = 234 Sheet 3 Cell A1 = 543 Sheet 4 Cell A1 = 945 I start off with this formula ='sheet 1'!A$1 Copy it down my summary page, then edit the sheet reference for each page. ='sheet 1'!A$1 ='sheet 2'!A$1 ='sheet 3'!A$1 ='sheet 4'!A$1 This is simple enough to do, but is laborious for lots of references.
View Replies!
View Related
Create Sheet For Each Name In Table List
I am copying info from a program into the "Input" worksheet - It is from my phone switch of logins and logouts of my employees. I have 11 supervisors and my end goal is to have each one of their coordinators show up in their specific tab automatically with all of their login information, ids, logins, and logouts. I can do the other math for the Marks and break lengths but I am having a hard time with this. I have been trying vlookup, but cannot figure out a way to bring all of the different rows... It only brings over one row. I have tried to use some of the code from other posts on this sight, but have not had any luck. What I am looking for it to do is on the Alis worksheet - the light blue sections. I am also finding it difficult in the light purple section also. I am trying to figure out how much time they were on the clock.
View Replies!
View Related
Create Copy Of Sheet For Each Name In List
The following URL has a great solution to this problem, I was unsuccessful in implementing it. Excel VBA: Create Worksheets for Each Item in an Excel Table of Data Need A macro to copy a pre-set sheet, we can call it a "template sheet", for each name in a pre-set range, a list. This list will have empty cells and names from F9 to F190. For each name i need it to copy the template sheet and place the sheet name within the new sheet. Should a user delete a sheet, activating the macro again should re-create the missing sheet and not just crash (was told there could be an issue).
View Replies!
View Related
Create Sheet For Details Of Each In Table
I have a work sheet(sheet1) that contains 700 people's information. Each row contains information for one person. Let's call the first person A. I have to copy certain columns of person A's response to another work sheet(sheet3) in the same file. Then, copy person A's e-mail address and save the sheet as person A's e-mail. Repeat the same steps for the next respondent. I have created the macro for person A already (including the saving part). Now the question is how to write the loop in the macro. Sub Macro1() ' ' Macro1 Macro ' Macro recorded 7/5/2007 by Jean Kuo ' ' Range("Q4").Select ActiveCell.FormulaR1C1 = "=Sheet1!R[-2]C[-4]" Range("Q13").Select ActiveCell.FormulaR1C1 = "=Sheet2!R[-9]C[-14]" Range("Q14").Select Sheets("Sheet2").Select Range("D4").Select Sheets("Sheet3").Select Range("Q14").Select Sheets("Sheet2").Select Range("D4").Select ActiveCell.FormulaR1C1 = "" Range("C4").Select Selection.Copy Range("D4").Select ActiveSheet.Paste Application.CutCopyMode = False ActiveCell.FormulaR1C1 = "=Sheet1!R[-2]C17" Range("C4").Select Sheets("Sheet1").Select Range("T1").Select Sheets("Sheet3").Select ActiveCell.FormulaR1C1 = "=Sheet2!R[-10]C[-13]" Range("Q15").Select ActiveCell.FormulaR1C1 = "=Sheet2!R[-11]C[-12]" Range("Q16").Select ActiveCell.FormulaR1C1 = "=Sheet2!R[-12]C[-11]" Range("Q17").Select Sheets("Sheet2").Select Range("F4").Select Sheets("Sheet2").Select Range("G5").Select Sheets("Sheet3").Select Range("Q17").Select ActiveCell.FormulaR1C1 = "=Sheet2!R[-13]C[-10]" Range("Q22").Select ActiveCell.FormulaR1C1 = "=Sheet1!R[-20]C[42]" Range("Q22").Select Selection.Copy ...
View Replies!
View Related
Create Comparison Code In VBA
I have to do monthly comparisons of two excel worksheets, one being a vessel timesheet and the other being an excel download from manpower software that we use. The comparison that is being made are days of the month, whilst the unique identifier between the two sheets (To make it easier to understand I will call them sheet1 and sheet2) is an employee ID. Both sheets, alongside the name and employee ID, list all the days of the month that employees have worked. If they have worked, there is a "1" under that day, if they have not the cell is blank. What I currently do manually is: 1: Search for the employee ID (and/or name) in sheet1 and compare the days with the employee ID in sheet2. 2: Highlight the differences 3: Move onto the next employee ID All differences are highlighted in sheet2. Differences highlighted are in the days only, where if any days are missing/extra in either sheet, then the particular cell(s) are highlighted in yellow. If an employee is missing from sheet1 but is in sheet2, then all the days are highlighted (in sheet2). If an employee is missing from sheet2 but is in sheet1, then that particular employee is copied to the bottom of sheet2 (after last row). As this is horribly complicated to explain, I can attach an example if this is sounding rather inexplicable? Is it possible to attach a xls to a thread?
View Replies!
View Related
Create A New Workbook By Vba Of Excel
I want to the following steps to be done by vba of excel. 1. copy ranges of cells in the active worksheet (sheet3) 2. add a new workbook and paste the copied ranges to sheet1 3. save the new workbook with the new file name (e.g. date) 4. close the new workbook and clear the contents the copied ranges of cells in old workbook. following code and make it more simpler? Worksheets("Sheet3").Activate If Range("l1").Value <> "" Then Range("l1").Value = CDate(Date) End If asdate = Range("l1").Value 'date entered by user resp4 = MsgBox(" Case particulars of " & asdate & " will be backed up and deleted from this sheet! Proceed? (Y/N)", vbYesNo, "Deletion of Data") If resp4 = 7 Then Exit Sub
View Replies!
View Related
Vba To Create A New File From Spreadsheet
I have the following spreadsheet: A-------------B File No.-----PRODUCT TYPE 123456-----NDT 123456-----NDT 123456-----NDT 123456--------- 123456--------- 789110--------- 789110--------- 789110--------- What I need is if there is an NDT in Column B and 123456 in Column A then I need to eliminate all rows which contain 123456. End result A 789110 789110 789110
View Replies!
View Related
Create Outlook Appointment From VBA
I am probably overengineering my macro, but I would like to setup an outlook appointment in two peoples calendars from my userform. The macro has access to the email addresses of the selected persons, I just want to send date/time and subject.
View Replies!
View Related
VBA To Create A New Folder From A Textbox Value
I don't know if anyone has tried this but it possible using vba to create a new folder in a directory from the text of a textbox? I have made a userform that I use to collect a persons first name & surname. I then created a folder in a directory manually (e.g Z:spnzphotos) I then scan their photo and place it into the folder. Is it at all possible to have a piece of code that once I press a command button is creates folder ready for me to add the photo to?
View Replies!
View Related
Create Excel Report Sheet With VB Button
I have attached the worksheet. As you can see its just a Job logging spreadsheet, What I am trying to do is create a jobs out standing log that will probably go in place of the Search Results sheet. I have a job Info sheet that is just for new jobs and a Jobs Done sheet that is for jobs done, in the Search Results sheet I would like to have Jobs Outstanding, this would be done by matching the Job Number in the Job Info & Jobs Done Info sheets and giving me a report on all outstanding Jobs. I would also like to add a Jobs Outstanding Button to the Intro Sheet.
View Replies!
View Related
Create Add New Record Macro In A Sheet
I have a table where I have dropdown menu for selecting data and a vlookup for filling other fields.However, I would like to create totals at the bottom of the sheet. But I dont know how many rows I will need because the data to this sheet are added from another sheet in the workbook. I would like to create something like this : No. Name Weight Amount Total Weight Unit Price Total Price 1. Product 30 2 60 100 200 then I will not have no. 2 , but add new record button that will create a new row and will copy the dropdown menu and the Vlookup function so the format will be the same for product no.2 as it is for the product no.1 ... thus I will not have any unfilled rows in the table and after the last row there will be a totals row that will sum up the whole table... How to do that "add new record button" so that in the table will show up only those rows, that are actually filled with data?
View Replies!
View Related
|