Formulae That Applies To All Sheets On Opening
Jan 14, 2008is it possible to have a sheet that i can type in formulae and the formulae will automatically copy itself into the same cells on any new sheets i open?
View 13 Repliesis it possible to have a sheet that i can type in formulae and the formulae will automatically copy itself into the same cells on any new sheets i open?
View 13 RepliesSo I have a macro that sends an email of the active spread sheet. I want to add that macro to another macro. The tricky part is that i call other macros inside the macro. So is there a way i can add the send email macro and have it apply to all the macros i call. Here my code:
Code:
Sub Run_All_Billing()
'
' Run_All_Phones Macro
' Make sure you open "gateway.csv" "phone.csv" "ctiroutepoint.csv" and "Billing Contact.xls"
' Call Gateway Workbook and clean it up
Windows("gateway.csv").Activate
Call Clean_Up_Gateway
' Call Phone Workbook and clean it up
[Code] .........
Here's my send email Macro
Code:
Sub Send_Email()
'
' Send_Email Macro
'
Dim oApp, oMail As Object
Dim WB As Workbook
Dim ArchiveFolder As String, FileName As String
[Code] ........
So I want to add that send email macro into my Run all billing macro and it apply to all the macros I call.
On right clicking a closed file and if print is clicked, it is opening the file and printing the activesheet only and then closing the file. I want that it should print all the sheets continously and not only the Active sheet. How ths can be done?
View 9 Replies View RelatedI am designing a userform with a set of option buttons and a few corresponding combo boxes, which allow to view a ready-made report in excel. My problem is, how do I get the code to open the report I want? So far, the code looks like this:
Private Sub cmdshowreport_click()
frmmeipdashboard.Hide
If optcomm = True Then
If opttrd = True Then
ActiveWorkbook. Sheets(cbotrd).Activate
End Sub
cmd is the command button that I press when I want to view the report, opt is the radio butons, cbo the combo boxes. What is going on is you enable one button, then another, then choose a value from the combo box, and what I want is for the value in the combo box to be the value the code uses when choosing which sheet to activate.
I have some VBA code that formats my sheets and works fine, but the issue is that I run this same piece of code more than once in different sheets with the only difference being the formula references a different cell.
' Green Cells indicate that the supervision is within the year
.FormatConditions.Add Type:=xlExpression, Formula1:= _
"=Datedif(D8,today(),""m"")
I am trying to write some code that is linked to a Command button. The code in the command button is in my workbook called "MF Consolidated ACTUAL DAILY REPORT - Dev.xls" but then I have another workbook called "MF BANK EXPOSURE SUMMARY.xls" that I want to do some work with - namely delete blank columns and it is here that I am having the problem.
My problem is this: my code module is contained in my project "MF Consolidated ACTUAL DAILY REPORT - Dev.xls" and the columns that I want deleted are in the "MF BANK EXPOSURE SUMMARY.xls". Now even though I believe I have activated the "MF BANK EXPOSURE SUMMARY.xls" workbook the action, that of deleting the blank columns is performed on the "MF Consolidated ACTUAL DAILY REPORT - Dev.xls" workbook. Why?? Here is the code that I am using:
Sub Commandbutton()
'ASK FOR DATE AND SET IT IN THE REPORT
Workbooks("MF Consolidated ACTUAL DAILY REPORT - Dev.xls").Worksheets _
("Seg and Non Seg Bank Summary"). Range("I1") = Application.InputBox("PLEASE ENTER REPORT DATE IN THE DD/MM/YYYY FORMAT")
'ACTIVATE MF BANK EXPOSURE SUMMARY
Workbooks("MF BANK EXPOSURE SUMMARY.xls"). Sheets("Seg and Non Seg").Activate
Dim iCol As Integer
Dim Isheet As Integer
With ActiveSheet.UsedRange................
I am preparing a simple document for employees to use that requires viewing two sheets simultaneously.
To make it user friendly I would like, if possible, to save it so that when opening the file, the two sheets open side by side without the user having to open the new window and juggle with window sizes etc.
I have 3 sheets: 1: master entry sheet that fills data in 5 different excel docs. Then there is another doc that aggregates data from the 5 and presents totals on the data. I am trying to get the end result without having to have 7 different excel files open, but when I enter into the master entry sheet, the data doesn't seem to be "pushed" up to the 5 different docs until each one is opened up. Obviously, the master aggregator is not updated since the 5 don't have the new data. When the files are all opened at the same time, the data flows perfectly, I'm just trying to find a way to avoid having to open the 5 docs in the middle of the process.
View 9 Replies View RelatedI have an Excel 2007 workbook which has five sheets in. I just wondered whether it is possible to hide all five of them when the workbook is first opened. Also I would like the user to be asked for a password when they wish to unhide a sheet, with the password being different for each of the sheets.
Is there also a way to do this which won't be affected by Excel disabling all Macros when the application initially opens.
I have a database on one sheet and a 2 count if formulae recording information on the next to be exact one formulae counts the number of monthly values and the other count yearly values. I want the sum of these formulaes to be equal or less than 25. and to show an error if the sum of these is mor than 25.
View 9 Replies View RelatedI am slowly working my way thru Excel succesfully but have come up with another one I can't find an answer for..... YET
I simply want to subract the value of two cells, however the values of those cells are produced by formulae. Hence I get the #Value! error.
Once again I know there's gotta be a simple solution, I just can't locate it
I need to add a piece of code to a spreadsheet that will turn all formulae within into values. The number of tabs in the spreadsheet is likely to change over time but I want the code to apply to all the tabs - without needing to change it if a tab is added/ deleted.
View 3 Replies View RelatedIs there any way to 'evaluate' a dotted number (similar to an IPv4
address but not just those) using standard worksheet formulae (ie no
UDFs, VBA, or ATP functions)?
To make it a little more complicated, I need to be able to evaluate
not just IP addresses (although that would be a use) but also a
'number' such as 9.0.2 compared to 8.7.5 so that they can be sorted
and / or compared.
The views expressed are my own, and not those of my employer or anyone
else associated with me.
My current valid email address is:
1bupdvc02@sneakemail.com
This is valid as is. It is not munged, or altered at all.
It will be valid for AT LEAST one month from the date of this post.
If you are trying to contact me after that time,
it MAY still be valid, but may also have been
deactivated due to spam. If so, and you want
to contact me by email, try searching for a
more recent post by me to find my current
email address.
The following is a (probably!) totally unique
and meaningless string of characters that you
can use to find posts by me in a search engine:
ewygchvboocno43vb674b6nq46tvb
I found this post in the archive section. Its purpose is to find the Last Used Row in a Range, "A:A".
Using it, I get a #Name? error. I have placed the UDF in a module, placed the formulae in K1.
I have mixed data from A1:A34.
Function Used(r As Range) As Range
Dim q As Range
Set q = r.Parent.UsedRange.Cells(r.Parent.UsedRange.Cells.Count)
Set Used = Intersect(r, r.Parent.Range(r.Parent.Cells(1, 1), q))
End Function
=INDEX(A:A,SUMPRODUCT(MAX((LEN(USED(A:A))>0)*ROW(USED(A:A)))))
Have this workbook with over 34 worksheets. Exactly 31 sheets have over 700 rows & 5 columns of array formula. The cell references for these formulae are on "Sheet2" and the values in Sheet2 get populated after the macro is executed for Sheet1.
The macro when run, takes helluva time to complete and populate the values in these 31 worksheets. If I turn off the calculation, it throws out a an exception and on the top of it I have noticed sometimes that the computer hangs itself and becomes DEAD. The only option I got is to press the Reboot Button.
The same macro when run on less than 100 rows, works like a treat ! Could someone help me resolve this high density problem, the Excel way (I am not in a position or a situation right now - to use ADO Recordsets to rectify this problem and neither do I know how to use it). So if your suggestion asks me to use the ADODB then unfortunately it will not be helpful to me at the moment
I have tried by all means and now I am stressed out.
Sub try()
Worksheets("sheet1").Activate
Range("A5").Select
ActiveCell.FormulaR1C1 = "=R[-1]C"
Range("A5").Select
Selection.Copy
Range("A6:A65536").Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection.PasteSpecial Paste:=xlPasteFormulas, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=False
If I have a string of the form:
S:GenerealfoldereferenceFolder2FolderTest_ABC_2009_v2.xls
I would like to extract the ABC term, i.e. the term that liues in between the 2nd and 3rd "_" in the Workbook name (in the above example "Test_ABC_2009_v2.xls")
is it possible to have more than one IF function applying to a cell eg. if value in cell A1 is greater than 10 then Positive is written but if value in cell A1 is between 8 and 10 then Suspect is written.
View 2 Replies View RelatedEverytime that I insert a row into a worksheet which a number of formulae refer to, those formulae get updated automatically in such a way that it is not in my favour.
The formulae refer to rows 2:2000 on a number of different columns. Adding a new row shifts the references to 3:2001. I presume that I can stop this from happening
Example:
= SUMPRODUCT(('List of DD Donors'!E2:E2000)*('List of DD Donors'!F2:F2000='DD Tally'!E6)*IF(DATEDIF(('List of DD Donors'!G2:G2000)-1,DATE(2006,3,31),"m")>12,12,DATEDIF(('List of DD Donors'!G2:G2000)-1,DATE(2006,3,31),"m")))
changes to...
=SUMPRODUCT(('List of DD Donors'!E3:E2001)*('List of DD Donors'!F3:F2001='DD Tally'!E6)*IF(DATEDIF(('List of DD Donors'!G3:G2001)-1,DATE(2006,3,31),"m")>12,12,DATEDIF(('List of DD Donors'!G3:G2001)-1,DATE(2006,3,31),"m")))
I have a number of different formulae I want to invoke according to a choice. I am able to request the formula I want by entering them ‘in line’ as value1, value2 etc into the CHOOSE formula … e.g. =CHOOSE($H$1,IF(N3>O3,1,""),IF(N3<O3,1,""),IF(N3=O 3,1,””))
but this is cumbersome and confusing since I have a growing number of choices and some of the formulae are quite long. I want to enter them in a list and extract the formula which corresponds with the Index_num in the CHOOSE formula. I also need the cells in the formulae to be relative so this rules out using NAMES to refer to the formulae.
I would like a macro which works on the selected cells:
A number of the selected cells contain formulae with an apostrophe in the beginning.
I need the macro to remove the apostrophe and calculate the formula in those cells..
I have a macro which inserts rows at certain places in a data table. This works fine. I then want to copy the formulae from the the row aboove or below (dependent on certain criteria). This sort of works.
I have is that when the row is copied, the row numbers within the formulae do not change relative to the new row. Eg if I copied down "=A6" one row, the formula still says "=A6", rather than "=A7".
I have tried variations of
Selection.PasteSpecial Paste:=xlPasteFormulas
I also tried the AutoFill method (but this didn't work at all when I tried it with a whole row)
Previously, I would have selected ranges and then pasted on the active sheet. However, I am trying to re-educate myself in writing macros that do not 'select' ...
I want to write a For loop so that it checks the range G2:R2 of Sheet1 for the first non-zero cell in that range. When it comes to the first non-zero cell, it will change the formula of A2 on Sheet2 to have the SUM of that non-zero cell and the next two cells to the right. Example:
SHEET1-
G2 = ""
H2 = ""
I2 = ""
J2 = "3"
K2 = "4"
L2 = "8"
M2 = "9"
N2 = "2"
O2 = "5"
P2 = "3"
Q2 = "11"
R2 = "7"
SHEET2-
A2 = SUM('Sheet1'!J2:L2) --->"15"
I'm trying to write a function that returns, from a different sheet, the value in column C and row 6*current row.
For example, if the function is typed into cell B5 in Sheet 1,
the resulting value would be whatever is in cell C30 in Sheet 2
I tired the following but it gave me an error
=Sheet2!&"C"&(ROW()*6)
Line 1 - Dim IRow As Long means...yada yada yada.
I know that I can look up "Dim" and "Dim what" and "IRow" etc, but need to know how it applies in the "real world" application/spreadsheet.
I'm trying to make a schedule of deposits made for the month of March 2008. (Deposits are made on a daily basis.) With this, I wanted to know when the deposit would clear with the bank using the WORKDAY formula given that I have to count 6 banking days after the date of deposit (Saturdays and Sundays excluded).
I'm using Mac and I recently upgraded to Office 2008 (never tried WORKDAY formula in other versions). I am aware of the syntax used for this formula and it works just fine in other cases. But I noticed that with start_dates falling on a Thursday or Friday of the week, Excel would give me a result date that falls on a Sunday, which is odd given that it's supposed to ignore non-working days or weekends. (I haven't even gotten to inputting holidays yet.)
I have a need to open a file from my companies intranet. My current method was to open said file via the method that the recorder gave me. However, I would like ot be able to open a said file without having to start open another workbook.
This is the path:
[url]
So the command is this:
Workbooks.Open [url]
Links are not actual links
So what I need to know. Is how can I open this file without opening a workbook. I haven't been able to use the VB "Open Statement" to open a file and I don't believe that I've been successfull using the Filesystem object either.
I'm using an IF formula – BV2 =IF((OR(BQ2="yes",BU2="yes")),"Yes","No") - which just shows "#VALUE!" whenever BU2 shows "#VALUE!". Is there any way round this so that, if BQ2 showed yes and BU2 showed value, BV2 would say yes?
View 9 Replies View RelatedI have a sheet with a reference field that I want to sort. Each cell in the reference field has a formula in it, which specifies that the cell remain blank unless there is a value in the cell. The values are either text values or number values. e.g. =IF(ISERROR(S4),"",VLOOKUP(C4,'Rider Data'!A:G,6,FALSE))
When I sort the field in ascending order by the column that contains the formula above (using a macro written for this sort procedure), where the expected value is a text value, all the blank cells are sorted ABOVE the cells with text values in them, rather than below, even though they are blank cells. However,if I sort on a different column which contains time values or numerical values, the sort function works just fine. I have tested the VBA code that produces the erroneous sorting and confirmed that it happens only when sorting on columns that contain text values. I would like to sort text values in ascending order with blank cells BELOW the sorted cells.
How do you open IE6.0 from VBA
I tried:
Dim IntApp As Object
Set IntApp = CreateObject("Internet.Application")
With IntApp
' Change file name to suit
.Documents.Open Filename:="http://web addr/"
.ActiveDocument.Select
.Selection.Copy
End With
Get error: ActiveX component can't create object
I am using the following to code with a warning message. However this warning message appears each time the macro is run? Can this be modified in such a manner so that it will show the warning message only once for first time it is run on each opening of WB?
Sub mln()
Dim a
a = MsgBox("Please note that this will replace formulae with value.So you are requested to run this on a copy of the file.", vbYesNo + vbExclamation, "Important")
If a = vbYes Then
For Each c In Selection
c.Value = Application.WorksheetFunction.Round(c / 1000000, 2)
Next c
End If
End Sub