Reset A Spreadsheet With A Macro
Sep 23, 2008
As mentioned I want to create a button that can reset this/a spreadsheet.
DWOR_2.zip
I have locked all the cells and unlocked the cells with the light green background. I.e. where a user can input data.
I haven't added a password yet nor protected the sheet. (the macro needs to work when the sheet is protected.)
I am looking for a macro that can be used to reset the sheet to its original state. However, the sheet needs to be protected.
View 14 Replies
ADVERTISEMENT
Mar 11, 2009
If I run the macro and get the message box too pop up because I did not move, the macro will not run. I have too choose another one before I can get the one I want to work. I guess it needs a reset if the message box comes up.
View 4 Replies
View Related
Aug 20, 2012
From the keyboard, if you select a chart with data labels, right click the data labels then "reset the data lables to match style", it works fine; but there appears not to be a programmatic equivalent to accomplishing this same task... at least the macro recorder does not shed any light on the subject. Is there code available to do the same thing?
View 3 Replies
View Related
Aug 22, 2008
I have a pivot table with over 4000 entries and about 12 columns which i filter to get the info i want.
Unfortunately with so many rows and columns in the table, if i do a macro that gets each filter back to 'show all' its really slow.
Doing this manually using the "Show all" option in the filter takes a fraction of a second, so surely there must be a way to do this more quickly in VBA?
i can't understand why manually it takes no time at all, but automating it through recording a macro takes forever.
View 9 Replies
View Related
Jul 16, 2014
I am currently working on a workbook to have employees fill in data on what tasks they compelted for the day, and how long it took. There are 5 colums (for this purpose) Task, Description, Time, Required to complete, Completed. The tasks are predefined and listed out in each row. There is also a space for employees to select the date they are entering the data for.
I would like to have a macro that is linked to a submit button and when pressed populates this data into a database on another sheet. This database is split into two sheets (1 with time and one with tasks required/compelted). Each sheet has the list of tasks going down a cloum on the left, and dates along a row on the top. When the employee presses submit I would like this data to popuplate in the coresponding date and task fields and then reset the form on sheet 1 to all 0's.
View 1 Replies
View Related
Aug 12, 2012
In Excel 2010, you can color a cell with a fill color and a font color.
It can be done manually via one of 3 methods that I know of (aside from a macro or a routine):
-From the ribbon button (underneath the font size and increase and decrease font size toolbar buttons)
-By formatting the cell (right clicking on a cell),
-Clicking on the ribbon's font section (giving you the same 6 category format cell box as right clicking on a cell)
What I need is a routine that resets the Fill Color and Font Color toolbar buttons to "No Fill" and "Automatic" if I run it inside a macro or create a command button on a worksheet.
View 4 Replies
View Related
May 8, 2014
I have never written or used a macro before and I have a simple macro task to complete:
I have Column L (L4:L10) of seven scroll bars that move according to number changes in column F (F4:F10). I want to create a form control command button that resets the changes on the scroll bars according to static column of numbers in Column E (E4:E10).
I don't know if it matters, but I'll add that I plan to add a second button that does the same thing with a different column of data. I assume I'll simply replicate whatever procedure I use in the first button - is this okay?
View 1 Replies
View Related
Jun 26, 2007
I am working on a macro that copies tabs from the spreadsheet the macro (button) is located in, creates a new book for them, and then pastes values so that no formulas still exist. The problem I am having is with named ranges. The named ranges do not reference the new sheet, but rather the old spreadsheet. This is fine because the new file is solely for presentation, however, one macro (which selects print ranges based on user selected checkboxes) tries to reference the old spreadsheet once it runs. I would like the macro that I currently have working, to also make this macro in the NEW spreadsheet so that it can still highlight the correct print area when used. The macro does not reference the name of the workbook at any point, it is purely "Range("ai10") type references so I don't understand why it is trying to open the old sheet back up.
View 2 Replies
View Related
Feb 7, 2014
The attached workbook contains a macro ("Transfer_Data") that copies values from one cell to another when the "Update Progress" button (near cell A3) is selected. It works perfectly fine in this workbook but when I try the same code in another workbook, which looks and operates exactly like this one, nothing happens.
Is this due to a security setting or missing code line items?
copy&paste in next blank cell2.xlsm
View 10 Replies
View Related
Jun 16, 2014
We have a macro that opens a spreadsheet and pastes data from another sheet into it.
Is there a macro statement that will unprotect the spreadsheet if it is saved with protection (it is not password protected)?
View 1 Replies
View Related
Oct 6, 2008
Using Excel 2003. I have a macro set up to copy all information from one Excel workbook to another. There is quite a bit of going back and forth between the 2 workbooks. I ended the macro by clicking in a particular cell in the origination workbook.
When I exceute the macro though it minimizes both workbooks. I have used the VB Editor to make sure that there is code such as.
View 6 Replies
View Related
Apr 15, 2008
I have a spreadsheet with 28 columns. I need some column headings to be amended when I run a macro and I also need some columns deleted.
View 9 Replies
View Related
Nov 11, 2009
A macro which compiles a list of entries and adds or summarises the cost.
Sheet1 contains multiple entries per group and a cost in ColumnB
Sheet2 contains only one instance of the group with a summary in ColumnB
Here's an example and I hope it helps;
Sheet1
A1 = November , B1 = 100
A2 = November , B2 = 50
A3 = December , B3 = 75
A4 = December , B4 = 10
A5 = September , B5 = 60
After running the macro with CommandButton1
Sheet2
A1 = November , B1 = 150
A2 = December , B2 = 85
A3 = September, B3 = 60
View 9 Replies
View Related
May 21, 2006
when the user selects any cell(s), then hits the command button, I want the code to move the cell(s) selection to the far left i.e. Column "A". I've managed this is a roundabout way, but I'm trying to make a far more elegant version.
Set C = Selection
With C
While Not C.Previous Is Nothing
MsgBox C
Set C = C.Previous
Wend
End With
So C is the selection made my the user, for this example they are just selecting one cell. The MsgBox proves to me the code to moving the cell selection to the left, but the While condition falls as the Previous test condition fails and bombs the macro. I cannot think of another way of doing this. Is there a method that returns X and Y co-ordinates as numbers?
View 2 Replies
View Related
Mar 29, 2007
Trying to summarise large (but varied # of rows depending on which project is being reported on) table for specific values. I get the size of the sheet by:
FinalRow = Cells(65536, 1).End(xlUp).Row
FinalCol = Cells(1, 255).End(xlToLeft).Column
As all the search criteria are numbers lists from out ERP System, a 'For' 'Next' loop seems to work on the Auto-filter settings, and only display the matching values. As I am only trying to get the number of occurrences, and not do anything with the data in the sheet, the 'Count' function seems to work pretty well:
'Change to " proper" dates and insert TTC columns
Sheets("Data").Select
Columns("C:G").NumberFormat = "d/mm/yy;@"
Columns("F:F").Insert Shift:=xlToRight
Range("F1").FormulaR1C1 = "TTC"
Columns("F:F").NumberFormat = "0"
Range("F2").FormulaR1C1 = _
"=IF(AND(RC[-1]>0,RC[3]=2),RC[-1]-RC[-2],TODAY()-RC[-2])"
Range("F2").Resize(FinalRow - 1, 1).FillDown
Range("A1").FormulaR1C1 = "=COUNT(R[1]C:R[500]C)"
Range("A1").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)). AutoFilter
How can I replace the '=COUNT(A2:A500)' with '=COUNT(A2:A[FinalRow])' and only count the rows I need to? This sheet can change from between 20 rows up to 50K+. I understand that this may look messy, but have only been playing with VBA for about a month, and I shall tidy it up later.
View 4 Replies
View Related
Jun 3, 2014
Debug error points to:
BuildPlan(Worksheets(SourceWorksheet).Cells(j, "A"), Worksheets(SourceWorksheet).Cells(j, "E"),
Worksheets(SourceWorksheet).Cells(j, "F")) = Worksheets(SourceWorksheet).Cells(j, "K")
Sub is below:
Sub UpdateMonthForecast()
Dim Month As Integer
Dim Year As Integer
[Code]....
View 2 Replies
View Related
Feb 6, 2009
For simplicity, let's assume I have three columns, "Company," "Policy," and "Balance."
Example:
Company A Life $1
Company A Med $2
Company A Dent $3
Company A Disab $4
Company B Life $9
Company B Med $5
Company B Dent $7
Company B Disab $2
According to my post preview, the columns are running together, but I do have it arranged in three distinct columns. What I want to do is program a macro to do the following:
Every time the name of the company changes, I want Excel to insert two rows after the last of the group, and have a summation of the "Balance" column in the first inserted row.
This is what it should look like:
Company A Life $1
Company A Med $2
Company A Dent $3
Company A Disab $4
$10 <- (this should be directly under the $4, but I'm not good with forum languages)
Company B Life $9
Company B Med $5
Company B Dent $7
Company B Disab $2
$23 <- (same with this - should be directly under the $4)
View 3 Replies
View Related
Jan 6, 2010
Need the code to put into a command button which jumps from the cell selected, X number of cells to the right. Also will need the code to jump back again when clicking on a different command button.
View 5 Replies
View Related
Jan 27, 2010
How do I create VBA macro to create CSV files out of Excel spread sheet for each tab? Right now I am manually opening the spreadsheet and saving each tab as CSV file. But it is taking lot of time if we have lot of tabs.
View 14 Replies
View Related
Nov 16, 2011
macro code to clear a spread sheet of all of its content? (The extent of the content can vary.)
View 2 Replies
View Related
Sep 25, 2013
On sheet1 I have 6 products in E15:E20 and their prices in AB15:AB20.
I have created userform1:
Step 1. When the form shows I'd like the products in E15:E20 to show under "Product" and prices in AB15:AB20 to show under "Price".
Step 2. The user needs to be able to add a price value in either the "-Disc" and/or "+Fees" fields, from this the adjusted price should show in "New Price"
Step 3. When the user hits "Add", the value under "New Price" needs to show up in AB15:AB20. To complicated this last step (maybe) in cells AB15:AB20 is:
Code:
=IF($R15=0,"",IF(ISERROR(SUM(INDEX(Data!$V$3:$Z$114,MATCH($E15,Data!$U$3:$U$114,0),
MATCH($B15,Data!$V$1:$Z$1,0))))+
SUM(INDEX(Data!$AO$2:$AS$7,MATCH($T15,Data!$AN$2:$AN$7,0),MATCH($B15,Data!$AO$1:$AS$1,0))),"",
SUM(INDEX(Data!$V$3:$Z$114,MATCH($E15,Data!$U$3:$U$114,0),MATCH($B15,Data!$V$1:$Z$1,0))))+
SUM(INDEX(Data!$AO$2:$AS$7,MATCH($T15,Data!$AN$2:$AN$7,0),MATCH($B15,Data!$AO$1:$AS$1,0))))
So whatever value is entered into "-Dsc" or "+Fees" needs to be added and/or subtracted from this formula.
I don't know much about vba, the best I could come up with is:
Code:
Private Sub cmdclose1_Click()
Unload Me
End Sub
Private Sub cmdadd1_Click()
[Code]......
View 5 Replies
View Related
Jul 8, 2014
I was wondering if there is a way to add a text box into a specific part of an excel sheet
I've got a document and want a macro so when I click it it inserts a new textbox from cell E167 to X219
if I can only insert one with size its aprox 90% of A4 size.
I've tried recording one but it does not work.
View 3 Replies
View Related
Dec 16, 2009
I am trying to write a set of code, part of which involves moving a shape around an excel spreadsheet in a square shape within a certain range. It is based on a random number generator. The shape moves a number of cells to the left/right/up/down depending on the random number (d) multiplied by 16. If the shape reaches a row or column border point, it will change direction but continue moving in the new direction until it has gone as far as was determined by the random number (*16). I have some code which works fine... to a point! The shape starts out, reaches a right hand border, changes direction to go up, reaches another border, changes again and goes left, but then when it comes to change dorection the 3rd time and go down, it fails. The direction of the shape is determined by a word in cell A1 - left/right/up/down:
Sub MoveRed()
Application. ScreenUpdating = True
Dim d As Integer
Dim i As Integer
d = Range("AZ1").Value
With ActiveSheet.Shapes("RedDot")
For i = 1 To 16 * d
Select Case Range("A1").Value
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
View 9 Replies
View Related
Feb 11, 2013
I have a number of spreadsheets, all of the same format, saved into ("C:Email Attachments").
I wish to populate a master workbook, using a macro to loop through all of the workbooks in that folder, copying all of the data (Starting at B52-Q52) using Selection.End.Down, as the row count is always different and pasting it into the master workbook. Sometimes there may only be one row, so an IF statement may be required, to say if there is nothing in B53 then don't do Selection.End.Down. The overall result would be for all of the data from each spreadsheet is detailed as one big list in the master spreadsheet.
View 4 Replies
View Related
Jan 16, 2010
How do I write a macro that will delete every other line on a spreadsheet? I can create a macro that delete one line using the Record a macro command but what do I ad at the end of the macro to keep it going until stopped with Ctrl Break?
View 13 Replies
View Related
May 21, 2014
I created a very simple macro, which actually works.
There is a button on my spreadsheet, so the user can launch the macro using this button.
[ Code] .......
At the moment the user clicks on the button, the part of the macro which is hiding the rows will not take place if the cell activated at the moment of launching the macro is in the range below :
The table on my Excel sheet covers range A5:E49
If the active cell is anywhere in A6:49 or C5:D24 or C25, the hiding part of the macro will not work. Launched from any other cells on the spreadsheet it works fine.
The rest works fine and I am not getting an error.
To solve this I just need to add the line Range("G9").Select and it will work.
But I would like to understand why it does not work from the cells given above. My sheet is not protected and I unlocked the cells just ion case.
View 2 Replies
View Related
Nov 9, 2012
I Have a tool which will be used online & offline.
I would like a box to appear on the opening of the spreadsheet which asks the user "Are you online?", with options "Yes" & "No", if the user selects "Yes" then a macro (which i have already written) refreshes the spreadsheet.
if the user selects "No", the sheet is not resfreshed.
What is the best way to do this?
View 2 Replies
View Related
Oct 11, 2013
I'll need a macro that detects all data have been recorded starting row C3 (see photo) and then goes to spreadsheet 2 (plan2) and select the first empty row starting in C3 (see photo) and paste the data.
Plan1:
Plan2:
View 3 Replies
View Related
Jan 20, 2008
Is it possible to move rows of data in a spreadsheet to multiple spreadsheet accordingly?
I had lists of tasks in a single spreadsheet and i need to segregate the tasks for all my staff in serial while no duplication among all of them. For instance, i got 4 personals in my department and i need the 1st 4 tasks to be distribute to each of them and next 4 tasks accordingly. This is due to all tasks are equip with due date and i need to calculate how much time i need to accomplishing them. i'm used to manually move it and found it time consuming, so i was wondering if someone would instruct me where or how to achieve it by using a simple macro.
View 9 Replies
View Related
Jul 20, 2014
I am trying to create a workload spread sheet for work I need to have the same looking spread sheet 365 times but also need each sheet to be dated, EG (tue,01/04/2014 through to tue,31/03/2015) I can create 365 tabs that have the same spread sheet on and I can create dates but not do both at the same time, it isn't fun doing copy and paste 365 time.
View 1 Replies
View Related