Non-Continuous For Loop
Apr 22, 2006
Here is what I want to do:
Sub test()
Dim num As Integer
For num = 10 To 20 And num = 30 To 40 And num = 50 To 60
msgbox num
Next
End Sub
Rigth now I have to do this:
Sub test2()
Dim num As Integer
For num = 10 To 20
msgbox num
Next
For num = 30 To 40
msgbox num
Next
For num = 40 To 50
msgbox num
Next
End Sub
View 4 Replies
ADVERTISEMENT
Mar 22, 2013
How do I continuously loop various sheets in different workbooks pausing then for 5 seconds on each sheet (not all sheets in each workbook).
View 2 Replies
View Related
Oct 6, 2006
The situation is that I get a report on a daily basis with many account numbers included in it. I am only concerned with 22 of them. What I am trying to do is look at each account number and compare it to account numbers I have defined in the array. If the account is found then advance to the next row and begin the search again. If the account is not found in the array, then delete that row. Once I have told excel to delete the row, I also tell it to stay on that same row and continue the search. For instance if row 5 did not contain an account number in my array, then that row will be deleted, but since the row is deleted, row 6 just became row 5.This bit of code seems to also cause my code to stay in the loop.
I need to tell excel that if there is no more information to be evaluated, then exit the For Each statement. I donft want to exit the sub, because I need to add additional code, I just need it to exit the loop.
Sub SortFailRpt()
Dim lFailRows As Long
Dim Ary() As Variant
Dim x As Integer, AryIndex As Integer
Ary = Array(1843, 1844, 1845, 1847, 1906, 1907, 1940, 1967, 1982, 1983, 1984, _
1985, 1986, 1987, 2045, 2087, 2088, 2096, 2106, 2108, 2109, 2110)
lFailRows = ActiveWorkbook. Sheets(1). Range("A65536").End(xlUp).Row
For x = 2 To lFailRows
On Error Goto NotFound
For AryIndex = 0 To 21
If ActiveWorkbook.Sheets(1).Range("B" & x).Value = Ary(AryIndex) Then
Goto NextVar
End If
Next AryIndex
NotFound:
ActiveWorkbook.Sheets(1).Range("B" & x).EntireRow.Delete
x = x - 1
NextVar:
Next x
End Sub
View 6 Replies
View Related
Mar 19, 2014
Is there a way to select cells with formulas for a top row and then fill down the formulas for these non adjacent, non-contiguous, etc. columns? I can paste a single formula, but not varying.
i.e. Cells A1, D1, and G1 have my formulas, and I want to identify that they have formulas in the first place and then drag down to let's say A10, D10, and G10. I will not know which columns contains cells before hand, and the given formulas are not fixed
View 9 Replies
View Related
Nov 17, 2012
I need to rank a list that is not continious. I have used the rank function before but its always been in list of numbers.
How do i get the rank to work for example, I only want to rank on cells: B3, B6, B8, B10
View 3 Replies
View Related
Feb 17, 2013
I found instructions within this forum to successfully create a macro to start continuous recalcs of my excel spreadsheet to keep now() current.
Sub continuousrefresh()
Application.OnTime Now + TimeValue("00:00:05"), "continuousrefresh"
ThisWorkbook.RefreshAll
Calculate
End Sub
I want to be able to set up another macro to STOP this continuousrefresh macro. I think this should be easy but I am just not getting it.
View 1 Replies
View Related
Jun 29, 2006
I have attached an example Excel file that shows what I am looking for. I have one sheet with a list of parts in inventory. Each part, we'll call them A-F, has a reorder point and will automatically detect whether or not the B column should say order or not. What I want is a second sheet that will list all the parts that need to be ordered continuosly, without the breaks where parts dont need to be ordered.
View 9 Replies
View Related
Feb 25, 2014
I have a set of data that has repeating column headers. So, on a sheet called "January" I have "Forecast" and "Actual" headers that repeat over and over underneath "Week 1", "Week 2", etc. On a different sheet (called "2014"), I'm trying to write a formula that will produce the latest or rightmost number underneath the "forecast" header. What I want is to be able to input data into the "January" sheet every week so that I have a record of progress and I want the "2014" sheet to show the latest data for every month.
View 5 Replies
View Related
Mar 27, 2014
Find attached , expected result in on w2 needs to be 9 that I have punched manually : Team(A)01.xlsâ
View 14 Replies
View Related
Dec 23, 2013
how to to get a continuous number in a cell without the increase in holidays that is Sunday etc.,
View 1 Replies
View Related
Apr 19, 2009
find a continuous data range in Column A of a worksheet with a header in A1. But now I'm thinking that I asked the wrong question. Each day I have new data (a series of numbers) that are moved into column A of a spreadsheet. I never know ahead of time how many numbers will be in the data set. And I need to perform a series of calculations on the data. I need to do the following:
1. Find the range of the data set.
2. Perform a series of calculations on the data set.
3. Report the results in a new location.
If #1 is pre-defined, then #2 and #3 are very easy. However, #1 is causing problems. I can find the range as a string:
View 4 Replies
View Related
Oct 22, 2011
Will it be possible to Count continuous occurrence of each signs 1-X-2 and arrange them in corresponding column From Q To AE as shown below in example table: 1
Draw result is shown in cells A2:N11 and result of Count continuous occurrence of each signs 1-X-2 is shown in cells Q2:AE11
For example we take a look row 7 where first sign-2 has occurred 3 times, as
Column Q is for to place result of sign1
And column R is for sign-X
So far count of sign-2, which is 3 times, must be paced in cell S7,
And then count of sign-1, which is 1 time, must be placed in cell T7,
And then count of sign-2, which is 5 times, must be placed in cell V7,
And finally count of sign-X, which is, also 5 times, must be placed in cell X7,
[code]....
View 8 Replies
View Related
Oct 9, 2003
I'm trying to use Indirect in a formula where named range refers to multiple non adjacent cells; e.g. ever other cell {A1, A3, A5... etc}; however, when I use indirect, I recieve a #ref error. Replacing the indirect with the actual named range will make the formula work just fine, or using a named range that a continuous range works fine as well. It seems that indirect doesn't like non continuous ranges. ?
View 6 Replies
View Related
Jul 31, 2013
Will it be possible to Count continuous occurrence of each signs 1-X-2 and arrange them in corresponding column From Q To AE as shown below in example table: 1
Draw result is shown in cells A2:N11 and result of Count continuous occurrence of each signs 1-X-2 is shown in cells Q2:AE11
For example we take a look row 7 where first sign-2 has occurred 3 times, as
Column Q is for to place result of sign1
And column R is for sign-X
So far count of sign-2, which is 3 times, must be paced in cell S7,
And then count of sign-1, which is 1 time, must be placed in cell T7,
And then count of sign-2, which is 5 times, must be placed in cell V7,
And finally count of sign-X, which is, also 5 times, must be placed in cell X7,
Example table: 1
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACAD1P1P2P3P4P5P6P7P8P9P10P11P12P13P14
1X21X21X21X21X221X21X21X21X21X
11111111111111
3111XX22X11111X
322
1
51
[code].....
View 1 Replies
View Related
Mar 6, 2014
I'm a novice when it comes to macros but was wondering would it be possible to develop one to get continuous averages for a set of data. It's a very big data set with my first observation starting at A1 and last at over A19,000. The data is broken up half hourly so the first average would be from A1:A48 the second from A49:A96 and so on. Can a macro be created to repeat this format rather than me having to continuously highlight the different figures to get an average?
View 9 Replies
View Related
Mar 4, 2008
1) The following formula returns TRUE or FALSE:
=AND($J$15"",(MOD(SECOND(NOW())-1,6)+10) = COLUMN())
It works fine as long as the w/b is busy doing something!
2) Otherwise if the w/b is not busy, the formula appears to be calculated only ONCE at the current time NOW(), and F9 must be pressed repeatedly to re-calculate the formula despite Tools::Options::Calculation is set to Automatic.
3) Is it possible to have NOW() representing a progressive NOW()?
4) If not, can the above formula be modified such that it is evaluated continually for, say, the next 60 or 120 seconds from the current NOW()?
View 9 Replies
View Related
Dec 3, 2008
I am using excel2000 on WindowsXP. I have a 2D surface plot pointing to data that can be continuously updated using a scrollbar from the Forms toolbox. For some reason, when I place the plot over the continuously changing cells, the plot does partially update when I scroll, and then fully refreshes once I let go of the scrollbar handle. If I move the plot far from the changing cells, it doesn't refresh at all until I let go of the scrollbar, so I'm forced to use it to page, instead of smoothly scroll. How can I get the whole surface to refresh continuously? Seems some kind of magic "event" logic is at work here....
View 9 Replies
View Related
Aug 21, 2008
I have a range G7:6107 is sheet2, cell G7 directly references cell C2 in sheet 2. Cell G8 in sheet 2 reference C9 in sheet 1, G9 is C16 and so on. For evey one cell down n column G in sheet two, it reference 7 cells down in column c in sheet 1. I now need to insert the same formula into each cell G7:C107, but I would like to keep the current references that are there. When I overight the current refernce in G7 with the formula, and then try to copy and paste all the way down to G107 it will only copy the reference row by row. so G7 is correct, but G8 refernce C3, G9 refernce C4 and so on. Is there a way i can insert that cell reference into a formula, mabye by useing collum H and type my formula and put "insert refernce" somehow. Is this possible? Or could I do it the other way, and insert the formula into the G7:G107 range.
View 2 Replies
View Related
Apr 22, 2006
I have data on two rows and would like to have a continuous chart instead of splitting it into two series. see attached file.
View 4 Replies
View Related
Aug 11, 2006
I am trying to print non continuous ranges of data in the same worksheet using the print area - by keeping the ctrl button pressed etc... it works fine but the outcome is that the text in the pages becomes very smaller when compared to when you print page by page and fit every page to one.
View 2 Replies
View Related
Oct 10, 2007
I want to select a range of cell relative to A2 then copy and paste that range 12 times.
See my coding below. I have been getting a Warning box titled "Microsoft Visual Basic"
(X) 400.
Sub mycopytry()
Dim check As Integer
For check = 1 To 12
Range(ActiveCell.Offset(29, 0)).Select
Selection.Copy
ActiveCell.Offset(1, 0).Select
ActiveSheet.Paste
check = check + 1
Next
End Sub
View 9 Replies
View Related
Jan 18, 2008
I am trying to write an array using =sumproduct. I cannot get the second array to work. Whenever I split up the arrays they work fine separately, but not together. This is what I am putting. Any help is greatly appreciated. I am not sure if I am even using the correct formula.
=SUMPRODUCT((B37:B51="Math")+(F37:F51)+(I37:I51="Math")+(M37:M51)),[(B18:B31="Math")+(F18:F31)+(I18:I31="Math")+(M18:M31)]
So basically, I am creating a transcipt. So in column B if the subject is Math, I want column F to be added and so on and soforth. See there are more arrays, because it is broken down to grades 9, 10th, 11th, 12th. And what is being added is their credit (.5 or 1) for the class for each year.
View 9 Replies
View Related
Aug 5, 2008
I am building a macro to conditionally edit cells that meet certain criteria within the current selection:
Dim FinalStr As String
If CheckBox3.Value = True Then
For Each cell In Selection
If cell.Font.ColorIndex = Range2.Font.ColorIndex Then
FinalStr = FinalStr & "," & StrConv(cell.Address, 1)
End If
Next
End If
FinalStr = Right(FinalStr, Len(FinalStr) - 1) 'To remove extra "," at the beginning
What I am getting from this macro is a string like "$I$27,$J$27,$E$28,$F$28" that I use later to edit that range, for instance
Range("$I$27,$J$27,$E$28,$F$28").ClearContents
It worked fine, however, I found later that XL cannot handle more than 20-30 individual cell addresses. The error msg I am getting is: " Method 'Range' of object '_Global' failed " Note that it won't be very practical to pick the cells and edit them within the same loop since there are several criteria times several edit options.
View 9 Replies
View Related
Sep 30, 2013
I have a big sheet and i want to create a mask where i can insert a value and in a ListBox appears all accurrences of this value and the other in the same row.
I created a listbox where, with the RowSource proprety show me LAST row where there is the value i want. Now i want a list of rows not continous in the sheet. For example i have this sheet:
A1 Jim B1 23 C1 1998
A2 Steve B2 27 C2 2010
A3 Francis B3 23 C3 1992
Now i want to search all people with 23. So i want in my ListBox appears:
A1 Jim B1 23 C1 1998
A3 Francis B3 23 C3 1992
View 4 Replies
View Related
Feb 10, 2009
I need to graph a function of SIN(X), I did it by writing my x-values in one column with small steps between each value and then calculating the sin(x) value in the column next to it and then graphing the two columns. But this raquires a lot of space on the spreadsheat and it would be convenient to be able to write it on the form y=sin(x). having x defined as a continuous variable. and then plotting the graph
View 2 Replies
View Related
May 3, 2013
I have attached the worksheet i am currently working on -snapshot of a 2.9 mb file :-).
I have a table i need the information compressed based on the values being greater than '0'. The original table Column A-E runs down 15000 rows but i am only interested in the values that are greater than '0'. I would like to see G3 to contain the first cell from A to contain a value greater than 0, G4 to contain the next sell with a value greater than 0 -- so on and so on.
This method will apply to columns G-K, their may be another formula that i am unfamiliar with that will get this to work.
I have already tried to play around with INDEX and MATCH, i think i am on the correct path but i am not looking at something the right way.
View 5 Replies
View Related
Nov 15, 2013
I want to extract text from column A into column D,E,F based on condition on column B. I am able to do this by IF statement, but the data is not continuous. I want to extract continuous data into D,E,F columns without any gaps.
Condition for Column D: >1
Condition for Column E: >0.5<1
Condition for Column F: <0.5
I am attaching the sample list for reference.
View 7 Replies
View Related
Jun 19, 2014
I have attached my excel sheet. I have continuous fraction numbers in every attribute value. How can i write vba code for replacing continuous fraction numbers in on row
Attribute name1 Attribute Value1
materials1 1/2 IN ID, 2/3 IN LG, 4/5 IN OD 1/4 IN THK
materials2 1/2 IN ID, 2/3 IN LG, 4/5 IN OD
materials3 1/2 IN ID, 2/3 IN LG
example: 1/2 IN ID, 2/3 IN LG, 4/5 IN OD 1/4 IN THK in a single row
I have TOOL OUT sheet
ModelNumberAttributeValue Replace Value
1materials2/4 IN LG, 3/4 IN ID, 5/9 IN OD,1/15 IN THK
2materials1/2 IN LG, 2/9 IN
3materials4/15 IN
4materials5/18 IN
5materials4/19 IN
6materials2/4 IN
7materials1/2 IN
8materials4/15 IN
9materials5/18 IN
10materials4/19 IN LG, 9/8 IN
11materials2/4 IN LG, 3/4 IN ID, 5/9 IN OD,1/15 IN THK
I want this to converted in (Replace value column)
Example 0.5 IN LG, 0.75 IN ID, 0.55 IN OD,0.06 IB
Tool_to_replace_Fraction_to_decimal_v1_MrShorty.xlsmâ
View 14 Replies
View Related
Jan 3, 2009
Is there a way I can get a continuous list, ie no missing rows, from a much larger list. (New list in separate columns to the R of the list.) I want to extract data from column A, only if the data in col C matches my specified criteria - I want this info to appear as a list with no gaps, ie I can do this easily using "If" but there will be lots of blank rows doing it this way.
Furthermore, as I need two different lists from the same data block, I need to specify whether number (extract these to col N) or text (extract to col O).
View 3 Replies
View Related
Aug 9, 2012
I have a (very) large spreadsheet which contains a column of numbers. I am trying to work out a way to identify all of the times when this column has 3600 or more consecutive zeros. Ideally, I would like it to tell me how many and the size of these periods of 3600 or more consecutive zeros, but I would settle for something as simple as just highlighting these parts.
View 9 Replies
View Related