Macro-created Formula Disappears Without Pattern
Mar 13, 2007
On a sheet, I have a Worksheet_change sub that checks if the cell changed is in column 1, 10, or 19 and if it is, then the six cells to its right are filled with formulas I need. All formulas work, except for one. I've checked over and over again and the formula itself works fine - the coding behind it is exactly what it's supposed to be.
But for some reason sometimes the formula isn't put into the cell. I haven't found any pattern yet with this problem. Even stranger is that the formula is identical to one in another column before (which is also entered by the macro) and the other one has never disappeared yet. I'm setting both formulas with the abc.FormulaR1C1 property (I don't use the abc.Formula property to avoid having to write three different formulas - one for each possible column change).
View 3 Replies
ADVERTISEMENT
Jan 30, 2008
I have a very large spreadsheet which holds a lot of data, and has a custom reports system built into it, (i.e. running on a load of macro's)... The reports gather their info from a range of hidden cells which run different formula's to provide such results as 1 or 0 so that it collates into another sheet...
however, I have found recently that when I need to update any of the formula's and whatnot, the formula does the calculation and then disappears... whereas I need the formula to be there constantly so that the report is providing the correct information!
one such formula is:
=IF(AND(AC11"No Calc",AC11>=1,AC11
View 9 Replies
View Related
Jul 17, 2013
using Office Professional Plus (2013). Within my spreadsheet, I have a series of progressive dates to be used in as a timeline. Ultimately, what I need to accomplish is that when I change one date, all the proceeding entries update according to my timeline criteria (in this case 3 weeks or 21 days). I created a SUM formula that worked but only calculated one time. Once the calculation completes, the cell drops the formula. I need this to be constant as the dates often change. How do I get the formula to maintain? Further more, is there a better method to accomplish the task at hand other than the SUM option?
View 7 Replies
View Related
Apr 15, 2014
I have written a macro. The macro in question simply shows a user form. There is far more code within the user form itself. It is designed to automatically format a workbook.
I saved the macro as an .xlam add-in file to the default folder. I then added a button for the macro to my Quick Access Toolbar. This seemed to work great.
However, when I open a new file that I want to run the macro on, the button disappears. In fact, a 2nd Excel window opens up on my task bar. The original window still has the macro button, but the new window does not.
View 5 Replies
View Related
Jan 31, 2007
Pre-requisite: I would consider myself to be very poor with excel, based on what I've read on this forum and found on my web-searches. I have a worksheet that has a list of data on the left going vertically, then a summary of this data going horizontally across the top. It is not arranged in such a way that transposing the data will do what I want. I am pulling the 5th word out of the title of each block of the vertical data and need to show this word on the horizontal section.
When I use this formula to pull the 5th word: =MID(MID(MID(SUBSTITUTE(A2," ","^",4),1,256), FIND("^",SUBSTITUTE(A2," ","^",4)),256),2,FIND(" ",MID(MID(SUBSTITUTE(A2," ","^",4),1,256),FIND("^",SUBSTITUTE(A2," ","^",4)),256))-2)
I need to increase A2 to A30, then A58 (up by 28 every time) in every instance in that formula. The fill handle increases the values by 1, instead of 28 (even if I do 3 or 4 instances manually) How do I do this? I've run into this problem in other scenarios, and there HAS to be a way to get around it.
View 5 Replies
View Related
Apr 7, 2009
The spreadsheet I'm working on is kinda hard to describe, but I'll try.
It's a finance calculator of sorts that I need done, and it shows me the total cost of various products. Each of these products require different components, and numbers of components, and also these components all cost different prices. So what I have is the following spreadsheet setup:
View 9 Replies
View Related
Feb 14, 2008
Need a macro that will autofill in an email pattern from a customer list i recieve. So far i have been having to manually do it.. but when have documents over 3k entries.. ouch.
This is what i got.. hope the way i type it in makes sense
A ..........................B ..........................C
First name........Last Name ............Email Pattern
John ..................Smith ...............First name initial, last name@abc.com
John ..................Smith ...............First name initial, dot, last name@abc.com
John ..................Smith ...............First name, dot, last name@abc.com
John ..................Smith ...............First name, initial of last name@abc.com
Is there a macro i can make that will automatically fill in the email based on the criterea found in column C before the @ symbol? then take the required info from Column a and b?
View 9 Replies
View Related
Mar 2, 2014
b2 = a2 * 150
c2 = a2 * 145
d2 = a2 * 140
e2 = a2 * 135
[Code].....
in the first row i want to use the fill handle at 135 and drag rightwards so as to copy/retain the pattern (decrementing by 5, from multiplier 150 until 100)
how would I achieve that?
p.s I also want the formula for columns to work with the fill handle drag downwards.
View 1 Replies
View Related
Nov 1, 2011
I'm attempting to enter a formula into cells on a spreadsheet through a macro.
I want the formula to read:
=if(isblank(G1),"",month(G1))
but because this is being created within a macro it doesn't like the double quotations.
I can get it to display "0" but i want those cells to be NULL. Right now my only idea is to make an IF statement in the code that doesn't insert a formula in those instances, but I'd like to keep them all as formulas for later changes. Anyway around this dilemma?
Example Code (only a piece):
Code:
With Range("F1")
.Value = "=if(isblank(G1),,month(G1))"
.AutoFill Destination:=Range("F1:F" & lastrow)
End With
View 2 Replies
View Related
Aug 20, 2013
How to put a formula into my userform created in Excel.
What I have is 4 Combobox's which can select either 0,1,3 or 9 then each box has a weight which that number must be timed by this is the excel formula:
=SUM(L48*10,M48*10,N48*8,O48*6) so that was 9x10,3x10,9x8,3x6 Which gives me a sum of 210.
Can this be added to the userform so when the user selects the number from the dropdownbox it will calculate it into the total score?
This is a screen shot of the userform : Capture.JPG
View 4 Replies
View Related
May 2, 2007
I have created a non-subjective job evaluation spreadsheet, which takes data obtained from a work daily of an individual and is implemented in my spreadsheet. The columns of areas to be evaluated will average each individuals performance by averaging the individual to the rest of his shifts performance and a point system has been established depending on their work level. The situation I'm running into is I'm using the formula below to establish my point system. In an effort to be fair in every way possible, should a particular column end up with all zeros "0" this would then become the average, which should provide the individuals in this group with three "3" points. My forumula as it is set up will now only give one "1" point, when it should be three. The point system works great other than this one particular problem, when everyone has a zero. I'd sure appreciate anyone's suggestion how I might be able to add one more IF statement to this existing formula. Note: I29 is the cell for this particular column that represents the average of the column with data in it. I28 is 10% above average, I27 is 20% above average, I30 is 10% below average and I31 is 20% below average.
point system is 1 point for 20% below average, 2 points for 10% below average, 3 points for average, 4 points for 10% above average and 5 points for 20% above average.
=IF(ISTEXT(I3),0,IF(I3="",0,IF(I3<=$I$31,1,IF(I3<=$I$30,2,IF(I3<=$I$29,3,IF(I3<$I$28,3,IF(I3>=$I$27, 5,IF(I3<$I$27,4))))))))
View 10 Replies
View Related
Sep 28, 2011
I have the following code that creates a new workbook and names it after the value of a cell in another workbook. Another part of the macro will switch back and forth between the original workbook and the newly created workbook.
What is the best way to refer to new workbook? I'm familiar with the "workbooks "VARIABLE NAME".Activate" style but, the name of the new workbook will change every time the macro runs and I'm not sure how to refer to it.
the code below.
HTML Code:
Sub MakeNewBook()
Dim wB As Workbook
Dim nPath As String
[Code]....
View 3 Replies
View Related
Aug 11, 2014
I have the following macro set up to create a folder in a directory as per the contents of 2 cells
C2 = Folder name to be created
B2= Date for previous working day
[code]....
I then have another macro that moves files into a specified folder within the same location ( I then manually move them into the folder the first macro created)
Is there a way I could get the files to move to the newly created folder without me having to do it manually.
View 4 Replies
View Related
Aug 14, 2014
I've got a macro that I can rund when I click on a shape. It's called "Shape_Click".
Basically, I want this macro to be automatically assigned to any shape I create, as I create it.
I know the line will be something like: [Code] ........
View 6 Replies
View Related
Aug 14, 2014
I have a macro that runs when I click on a shape. This macro is called "Shape_Click"
I can apply that to a shape by selecting it and manually running this macro:
[Code] .....
How do I get the subroutine to run as soon as the new shape has been selected, rather than haviong to manually run it.
Something like "Sub Worksheet_ShapeAdded" or something like that? I can't work it out.
View 2 Replies
View Related
Jun 12, 2008
I am working in a macro that will do some calculations and I would like to end it by plotting the results in some charts. Results are in one dimension array form, with probably more than 1000 elements. Can anybody tell me if there is any limit for the arrays that are going to be asigned to the XValues and Values of the chart?
View 14 Replies
View Related
Apr 1, 2008
I have 100s of name ranges in my spreadsheet. I am using a series of drop down boxes for the user to select the info that they want to see. Based on the dropdown box, the macro "dynamically generates" a range name from which to pull the info.
For instance, if they Select Manager = Terry, Analyst 1, and Month = Jan, then the range name would be JanTA1
The if statement would dynamically create this name by concatenating the info
If manager = Terry
mnger = "TA"
if analyst = 1
anlyst = 1
if month = Jan
mnth = "Jan"
rangename = mnth & mnger & anlyst
So, I am dynamically creating the range name based on user selections...then to display it, I want to set the display cell = to the value
Range("display cell").Value = Range(rangename).Value
The problem is, I am getting an object error every time I try to refer to a range this way.
If I type:
Range("display cell").Value = Range("JanTA1").Value, it works
View 9 Replies
View Related
Jul 4, 2014
I am completely new to Macro's and VB and the macro below has been generated using the "Record Macro" function in Excel 2013 with a couple of very minor modifications based on some research I have done (hyperlink & input box). My ultimate goal is to make a copy of my "TEMPLATE", which is hidden and the copy could have a variety of names, then create an entry in my "SUMMARY" table that references cells on the newly created sheet. The new entry on the SUMMARY page should be entered in the next available row ... at the moment I need to make sure I have my cursor in the right place before I run the macro. I also want the first cell in the new "SUMMARY" row to create a hyperlink to the newly created worksheet.
The macro does what I need it to do, as long as I name the new sheet "Test", what I would like is for the Macro to recognise the name of the new worksheet and create links to that name. The rows and columns in each new sheet will remain the same, hence the R##C## part will always work.
The "SUMMARY" and "TEMPLATE" worksheet names will not (ever) change.
View 4 Replies
View Related
Jul 4, 2014
I am creating 4 Sheets from a Main Sheet by Filtering Data based on different values in a fixed column, then the Filtered Rows are automatically pasted in the respective sheets.
Then these 4 Sheets are creating another file.
The same thing done manually by Grouping the 4 SHeets and then Move Copy into a New workbook also makes the file heavier.
Everything works fine however though the data is not much the file is very heavy, so what do i do to make it of appropriate size ?
View 1 Replies
View Related
Feb 12, 2014
I am trying to write a simple macro to copy a drop down list I created in cell O2 and then paste in the same sheet. I need it to paste starting in cell A2 and then move to A4 and so on for every even row cell through A9778. I would also like it to keep a border around the cell. I can't find direction on how to tell it every even cell or defining x and then doing x + 1...
View 3 Replies
View Related
Mar 5, 2008
if it is possible to write/record a macro that will automatically add a summary/total row immediately below the data that is created from an advanced filter. (XL00)
View 12 Replies
View Related
Feb 21, 2007
I begin in the Word of VBA. It's the first time I've a formula which seems necessitate VBA to be written down.
Before to try to execute my complicate macro, I've begun with simple tricks. But I've got a strange comportment of Excel :
I've the following Sub :
View 14 Replies
View Related
Jul 17, 2014
I have created an Excel spreadsheet with data. I froze the top row and added filters. This document will be used by numerous people, so I would like instructions for them on how to update the data on the same page as the data.
I put the text box off to the right of the data, but when the data is filtered, the text box is hidden along with the hidden rows.
Is there a way to have instructions to the right of the data that will not be hidden when applying filters? It does not have to be a text box but it does need to be on the same tab.
View 1 Replies
View Related
Apr 3, 2007
i got the userform to popup when the workbook is open and the buttons work fine... only problem is when i click on a button, it will ask the user yes or no... if the user press yes, it performs the required macro without any problem... but when the user press no, not only it will close the question, but also closes the userform... I would like the 'no' to close the question but not the userform...
View 4 Replies
View Related
Sep 7, 2007
I have a chart that I just added some dynamic text boxes to. That is the text is linked to a cell so that the text is automatically updated.
I also have a scroll bar that is used to adjust one of the cells. However, now once I click on the scroll bar it just disappears. I can click on the space where it is located and it will appear for a split second. Also, if I scroll down in the worksheet and then back up over the scroll bar the image will be refreshed and I can see the scroll bar again.
I didn’t have this problem until I added the dynamic text boxes, it worked fine with static text boxes.
Does anyone have any idea how to get around this, or do I have to stick with the static text boxes?
View 5 Replies
View Related
Sep 26, 2007
I have an auto filter setup on some data. When I perform an advanced filter either in-place or to another location, the auto filter disappears. Is it supposed to be have like that? If so is there some sort of work around?
View 2 Replies
View Related
Sep 7, 2005
Whenever word wrap is applied the text is not visable in the cell. It
remains visable only in the bar above.
I have already confirmed autofit and it reduces the column to 1 character
wide.
I tried detect and repair on the installation and nothing.
I even upgraded from Excel 2k to Excel 2003 and no change.
View 14 Replies
View Related
Feb 7, 2014
I made a template file with a userform included to enter data into a protected sheet at the command of a button. When I open the template, everything works fine. However, when I use a macro to create a new workbook and import the template to create a new sheet (or several) the userform suddenly disappears! The template is saved as macro-enabled and the new workbook is saved the same way. What am I missing that I'm loosing the userform??
View 9 Replies
View Related
Oct 14, 2008
My Workbook contains the following macro in Sheet 1, which displays a pop-up calendar in L15 when that cell is selected:
Private Sub Calendar1_Click()
ActiveCell.Value = CDbl(Calendar1.Value)
ActiveCell.Select
Calendar1.Visible = False
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Not Application.Intersect(Range("L15"), Target) Is Nothing Then
Calendar1.Left = Target.Left + Target.Width - Calendar1.Width
Calendar1.Top = Target.Top + Target.Height
Calendar1.Visible = True
' select Today's date in the Calendar
Calendar1.Value = Date
ElseIf Calendar1.Visible Then Calendar1.Visible = False
End If
End Sub.........
View 9 Replies
View Related
Dec 3, 2012
I have a large spreadsheet with many cells that have a drop down list using data validation. The list is a named range with no blanks. Most of the cells show the default I have set. However, sometimes when changes occur in cells next to one with a drop down list, the default value mysteriously disappears and the cell appears blank. The functioning of the drop down lists is intact, it's just that the cell appears blank.
View 5 Replies
View Related