Reset Range In Function
Aug 1, 2009
On a worksheet the user can elect to view monthly data. The "From" and "To" months can be any they choose. For example, if they choose "JAN" and "JUN" as the "From" and "To" months, "JUL" through "DEC" are hidden from view.
I would like to be able to show "Year to Date" totals based on the "To" month.
I refer to the "To" month as the "ActiveMonth".
This procedure captures the "To" month (the "ActiveMonth") based on their input:
View 7 Replies
ADVERTISEMENT
Nov 6, 2009
SOLVED: adjusted functions. creating a vba macro for other reset goals. other goals have changed as well.
I have a table where the subsheets have the specific days that an employee uses vacation, sick, personal or other hours of off time. i wrote alot here to get my goals/thoughts down
my goal is to master one section then apply it to the other vacation date types. i'm stuck on going with a formula or using vb. also another concern is odd months such as someone hired 10/31 compared to a month like 6/30. not sure if this is a real concern.
a. need to reset vacation hours for the year based on annual anniversary date
-"vacation hours per year"
-"vacation hours remaining" =E8-('Vacation 1'!B8+'Vacation 2'!B8)
this data is taken from the subsheets. there is vacation 1 for jan-jun and vacation 2 for jul-dec
1year=40 hours
after 1 year anniversary =80 hours
3 years+ =120 hours
Vacation only rolls over for 3 months after anniversary date (this is a concern after part a is completed)
second part of my project:
b. vacation hours remaining can be carried over up until 3 months after their anniversary date. at this point they are wiped back to 0 until the next anniversary date (where the carry over hours recalculate)
ATTACHED TEMPLATE
things i am changing in design:
vacation hours per year (to include a formula to calculate anniversary date, with the amount given for 0 year, 1 year, 3 years....) rather than a manual added # (which was lets say 40 hours+ carry over hours)
-thats why i am separating the carry over hours... which i'm hoping to auto calculate by taking
anniversary date - 3 months in a statement to reset it back to 0 after the three month period.
View 7 Replies
View Related
Jan 18, 2014
In the below mentioned query, i want to reset the range according to the find result. Here the range I6 need to change with the active cell with a row down
Windows("Holiday Uploader Workings.xlsx").Activate
Cells.Find(What:=Reply, After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
[Code]....
View 3 Replies
View Related
Jan 27, 2014
I am having an issue with some code that I have typed up to reset the formatting for a specific range after having been copied from a different source. The issue I am having is the screen updating continues to reset no matter what I have tried. The code is a simple "Format Paint", but the range that is copied is located behind a graph in attempts to remain hidden. The primary function of the macro works fine, but every time I paste a value into the X8:AE54, the graph disappears and exposes cells I do not want to be seen.
[Code].....
View 1 Replies
View Related
Apr 13, 2007
In Mr Excel's Pod Cast on April 12th, he showed how to use the OFFSET function to define a range inside a SUM function. Then he had Conditional Formatting that would highlight the range that was being summed. Can anyone tell me what the formula would be inside the Conditional Formatting dialog box to get the OFFSET range to have a certain format?
View 9 Replies
View Related
Jul 23, 2013
I have a function
VB:
Function f1(Matrix As Range)
'Does something and returns f1 = a double
End Function
And a second function which defines and constructs a matrix of doubles to use as an argument in f1 to return a double:
VB:
Function f2(dD As Double)
Dim MatrixRed() As Double
Redim MatrixRed(1 To dD, 1 To 10)
For i = 1 To dD
For j = 1 To 10
MatrixRed(i, j) = i * j
Next
Next
f2 = f1(MatrixRed)
End Function
I get an output error (#VALUE). I think it has something to do with MatrixRed not being a range anymore?
View 2 Replies
View Related
Sep 8, 2009
I’m trying to use the SUMIFS function in Excel 2007 to evaluate the following formula:
{=SUMIFS(range to sum, range to evaluate, evaluation criterion)}
The range to sum is A1:A10, the range (dates) to evaluate are in B1:B10, and the evaluation criterion is that the date is before 31/10/1999.
So my formula looks like this:
{=SUMIFS(A1:A10,B1:B10,”<31/10/1999”)}
This works fine, but how do I refer the 3rd argument in the function to a date in a particular cell rather than typing in the date specifically?
View 2 Replies
View Related
Mar 25, 2009
I was just recently forced to create my first UDF and after how well it worked I now am very interested in learning more. I am trying to create a function to sort a range by the values in a specific column and return the range. I know this should be really simple but for some reason my code dies whenever it gets to my inner-most loop. I need to use this in a larger function but for now this is my only question. I did find that Excel 2007 has built in Functions for this but my company still uses 2003.
My
Public Function SortRange(rngToSort As Range, valCol As Integer)
Dim Swapper As Variant
Dim i As Integer, _
j As Integer, _
k As Integer
For i = 1 To rngToSort.Rows.Count
For j = 1 To rngToSort.Rows.Count - i
If rngToSort(j + 1, valCol) < rngToSort(j, valCol) Then
For k = 1 To rngToSort.Columns.Count
Swapper = rngToSort(j, k)
rngToSort(j, k) = rngToSort(j + 1, k)
rngToSort(j + 1, k) = Swapper
Next k
End If
Next j
Next i
SortRange = rngToSort
End Function
View 9 Replies
View Related
Mar 31, 2009
I have a workbook with several worksheets in the same format. I would like to have a function to output the sheets that have rows in which collumn A = X AND collumn B = Y.
I've been working on this one for a couple days now and I'm not making much progress.
View 9 Replies
View Related
Jun 5, 2006
I have a workbook with 20 worksheets the first is a summary called Discount Set the 19 sheets with various names
The 19 sheets in column H4:H40 u enter a number greater than 0 which is the quanty required. This is used to calculate a price on which ever row it is entered
the selection must only affect numbers as there are rows that are just shading and they contain no data .
So u could enter quanties on serval rows of different sheets to get a total price displayed in the Discount set
What I want to do is have button on the Discount Set which will clear any quantity that does not equal 0 back to 0 in column H which will reset the total 0.00
View 9 Replies
View Related
Sep 15, 2014
Reset Counter to Zero:
I have Record ID on Column A: Auto Increment
I have a vendor Name on Column B: Vendor 1, Vendor 2, Vendor 3
I have a Code on Column C, Code A, Code B
What I want to happen is the Counter to count +1 each time. it sees the same vendor, same code and only to count to 4. As soon as it counts to 4; the next counter should be 0 (Zero).
Col A Col B Col C Col D
======= ====== ===== =======
Record ID Vendor Code Counter
======= ====== ===== =======
1 Vendor 1 Code A 1
2 Vendor 1 Code A 2
3 Vendor 1 Code A 3
4 Vendor 2 Code B 1
5 Vendor 1 Code A 4
6 Vendor 1 Code A 0
8 Vendor 2 Code B 2
9 Vendor 2 Code B 3
10 Vendor 1 Code B 4
12 Vendor 1 Code A 1
13 Vendor 1 Code A 2
14 Vendor 1 Code A 3
15 Vendor 2 Code B 0
It can be either in VBA or formula...
View 2 Replies
View Related
Jan 15, 2009
Is there a way to take the values between C2 & D2 and have them automatically post in column F ?
View 2 Replies
View Related
Oct 24, 2008
is there anyway i can reset this to start at st001 ive got everything done but i need to reset the orders to start at st001
View 3 Replies
View Related
Jun 2, 2009
I know that a variable of string type is equal to "" before it's assigned a value. So I reset the value of strings to empty (i.e. "") when I want them clear of a value. I also know that variables of Variant Type are equal to NULL when they are unassigned so I reset them to NULL when I want to clear them of a value.
But what about a Long? When you declare a variable of Long Type or Int Type or Double Type, what is it's inital value when empty and unassigned. I assume it's not 0 since 0 is an actual number.
I want to reset my lng variable and clear it of a value. So I'm wondering what should I set to... How can i do this?
View 3 Replies
View Related
Oct 23, 2012
I have a textbox that pulls language using the following code:
Code:
Private Sub TextBox1_Enter()
TextBox1.Value = Sheets("Language").Range("B2").Value 'places the value of the cell into the textbox
[Code]....
Randomly and sporadically, when working in the textbox, the form seems to reset. By reset, I mean that the language resets to what was there originally.
View 1 Replies
View Related
Apr 1, 2007
When I execute a macro, and if during the macro execution I press the "Esc" key, the execution stops and I get a Microsoft Visual Basic window with the message that code execution has been interrupted with buttons to Continue, End, Debug and Help. If I click the "End" button, the window closes and Excel is at rest - which seems to be some sort of Reset process.
I have a need to execute that process while Excel is at rest.
Is there any way to code the process in VBA?
View 9 Replies
View Related
May 28, 2009
i have cells A1 to A10 filled with numbers
i have cells B1 to B10 blank
what i need to do is when something is typed in cell B1 - A1 to A5 are reset to zero and when i type something in cell B2 - A2 to A6 reset to zero.
I have tried to do this as a range ie
A1- A10 have numbers in B1 - B10 copy these numbers and reset if anything is typed in C1 with this formula =IF(C1:C5="",A1,"0") what it should do is reset B1 to zero if anything is typed in C1-C5 but only when something is typed in C1 does this work ..
View 9 Replies
View Related
Jun 20, 2006
I am not experienced at all with Excel, here is my problem: In column "A": I have 288 rows and has nothing but numbers in them. Row 1 is the lowest number, row 288 is the highest number. In each row the numbers typically increase; every once in a while the numbers may stay the same, but the number will never be lower. The numbers range from 0 through 600,000.
What I want to do is have column "B" follow column "A" until the cell total reaches 12000. The next cell in column "B" would then reset and start all over from "0". I want it to keep on reseting every 12000 counts. Another potential problem is that a majority of the time the cell value will not be an even 12000, 24000, 36000 etc. They may be more like A40: 11742 A41: 13201 etc.
View 5 Replies
View Related
Apr 20, 2010
My spreadsheet has 459 rows; however, the vertical scroll bar ends at row 569738. I have attempted to delete all of the extra rows by holding SHIFT and CTRL, striking the down arrow then right-clicking on the left margin of highlighted row numbers and choosing delete. I have also done the same procedure except clicking clear all from the editing menu. None of these methods has removed the rows and enlarged the vertical scroll bar to a proportionate size in relation to the number of rows.
View 14 Replies
View Related
Jan 16, 2014
How do I reset ALL the sorting in a file?
The first worksheet is all formula generated and has filters at the top, which I've variously sorted alphabetical. The second worksheet is raw data the user isn't intended to read.
Now I want to alter one of the formulas. The problem is, if I change it in row 2 and fill down I get all kinds of different information. This is because while the present formulas read
='other worksheet'!A265
='other worksheet'!A934
- and so on at random, when I resort them I just get A2, A3, and so on.
View 4 Replies
View Related
Feb 15, 2014
I currently have the following VBA to make a filter work automatically in column D:
[Code] .....
I also have filters in columns J, L and N.
I would like these columns' filters to reset when i open the worksheet, however the filter in column D to remain.
View 10 Replies
View Related
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
View Related
Dec 24, 2008
As before, please ignore the colored portions. They mean nothing. This is what I'm trying to do:
Every Monday the "minimum payment due" should reset to the same
as "payment per session" without affecting the rest of the columns.
This will help us in determining who owes us what, and how many classes they have paid for up-to-date.
View 14 Replies
View Related
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
Mar 24, 2009
I'm a noob to programming in XL, and am teaching myself through a project for manipulating vectors. One thing that has me stumped is that when I open the file in which I'm working, I get a "This action will reset your project..." message.
View 7 Replies
View Related
Nov 30, 2005
Is it possible to press a cell on the worksheet to clear all entered data in
the entire worksheet?
I have a worksheet that users enter several data in different pages and then
print a report. The next user will have to clear all eneries and then enter
their own data before printing the next report. At this time, we close the
program and reopen it which is a bit of pain, just wondering if we could
create a key (let call it "Reset all Forms" on the worksheet to press and
clear all data.
View 11 Replies
View Related
Jul 2, 2014
I want to iterate a For Loop changing one variable each iteration until the Total from the For Loop equals zero. Each iteration of the Do Loop keeps the previous Total from the For Loop and adds it. How do I reset the For Loop to start from Total = 0 at the beginning of the For Loop?
Sub PV_IRR()
Discount_Rate = Range("A2")
Total_Investment = Range("B2")
Annual_Return = Range("C2")
[Code]....
View 3 Replies
View Related
Dec 28, 2006
I've set up a BeforePrint procedure as follows:
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Application.ScreenUpdating = False
Dim ws As Excel.Worksheet
Set ws = ThisWorkbook.Worksheets("Objectives")
Dim i As Integer
With ws
For i = 9 To 33
If .Cells(i, 16) 1 Then GoTo NOTONE
If .Cells(i, 4).Value = "" Then
.Rows(i).EntireRow.Hidden = True
Else
.Cells(i, 4).Interior.ColorIndex = 2
End If
NOTONE:
Next i
End With
Application.ScreenUpdating = True
End Sub
... which works brilliantly....
My problem is that I don't know how to reset the sheet after the print!
Can anyone shed any light for me, please?
View 2 Replies
View Related
Apr 3, 2007
I have a formula that counts total number matched items. I need revise it so that the count is never greater than 9. I've been trying several ways - but never get the right end results. So if I have 12 items, the answer will show 9 for those rows, then the next set of rows would show a count of 3. Here is the formula that gives me the count
=SUMPRODUCT(($J$4:$J$4032=J406)*($B$4:$B$4032=B406)*($K$4:$K$4032=K406))
View 9 Replies
View Related
Jun 19, 2007
How come I keep having the same value for "lastrow". eg: 35
lastrow = ActiveSheet.UsedRange.Rows.Count
It doesn't matter how many rows of data I've changed, it still show lastrow = 35.
I tried to add an extra line above but still doesn't work:
lastrow = 0
lastrow = ActiveSheet.UsedRange.Rows.Count
View 9 Replies
View Related