How can you find the next non blank row after the active cell.
Tried this.
Sub test()
Dim Row As Integer
Dim non_blank_row As Integer
Row = (ActiveCell.Row)
non_blank_row = Row
While WorksheetFunction.CountA(Row) = 0
non_blank_row = non_blank_row + 1...
I am writing a Sub to identify the longest Collatzs Sequenze between 1 and 1000. How do I need to implement an inner while loop to count the steps of the inner loops to identify the longest Collatz sequence?
Sub LongestCollatz()
Dim i As Long
Dim maxSteps As Integer
For i = 1 To 1000...
Hi Excel gurus,
I have put a code together (see below - working code with no copyright, fell free to use it) that analyzes an action plan (excel file with columns for actions, date and time of begin and ending of an action etc.) and creates outlook appointments based on the information on the...
This is some recorded code from SAP to select a node within a VA03/CU51 transaction.
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)...
Can anyone please tell me what i am doing wrong on my loop.
it goes on and on until it crashes excel.
i tried it in so many ways.
Can you help me please.
What I need it to do is to continue to find every w that is on the list.
Thank you in advance
Sub tentativa()
Dim w As Range
Dim t As...
<tbody>
0down votefavorite
Having a heck of a time looping this; D2 is where my list starts. I would like to have it ran for d3, d4, d5, d6.... until a blank space.
This program searches for the name in Column D and if it finds it, it places it in Column E so that would need to also increase...
I have this code, to replace specific text in all sheets in same column.
It should automatically count cells in first column and accordingly run While loop.
But code is not able to count number of cells everytime. in Other words variable count value is not changing
Dim count As Integer
For...
Hi all,
I'm having trouble making this loop iterate:
Do While Cells(96, DtlNxtCol + 2).Value > 0
Sheets("Detail_Sheet").Select
Cells(10, DtlNxtCol).Copy
Sheets("Summary").Select
Cells(SumNxtRow, 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone...
Hi guys, I've been a lurker on the forums for a while now and I've gotten some great advice on some of my questions! Thanks for all the help! :) I now have a complicated situtation that I haven't been able to find the answer to. Apologies in advance for the long post; I’m just trying to include...
Hi guys,
I've been struggling with a macro, I'm really new at this.
I'm trying to do a cumulative sum from some values at Excel spreadsheet until that variable meets a given condition. Then, when that condition is met, I want a cell of Excel to take a value of another cumulative sum.
Sub...
I have a Macro that find a specific value in this case the word "BRILLANTE-2 (DES)", when the word is found a range is selected, cut and paste in other book.
I want repeat this instruction because the word ""BRILLANTE-2 (DES)" could be more than one time in the Sheet. When the word doesn't...
Hi,
The boolean expression for my While statement uses a return value from a function that I also need to use from within the statement block.
While ( (valueToUse=FromFunction())>-1)
DoSomethingElse(valueToUse)
Wend
The problem can be resolved with a ByRef parameter set to the return value...
Hello everyone - I've got a cell with several words in it and I want to capitalize only the names:
So, if I have a list with 3 names
Greg
Peter
Bobby
and my value in cell A1 is
greg -play the guitar for peter and bobby
I can probably do something like...
Hello everyone,
I am familiar with a few coding languages, including PHP, C++, etc, however I am new to Excel and VBA. I am attempting to create a do-while/do-until loop which stays in the same column, and keeps descending row to row until it hits a Gray-filled cell, at which point it takes...
macro to move around a sheet. I have some VBA code in Worksheet_Change
It worked, sometimes... other times it caused Excel to go off into random orbit and I would have to kill it in Task Manager. The error message indicated a problem with .Range.
The spreadsheet comprises four rows that...
Hello
I don't think there is a "while" formula allowing me to do what I want so may need VBA help!
I want to make Excel understand that as long as the cells in column C are not empty, it needs to copy into cell A the value of the first non-blank cell C.
For example: there is "7000" in C1. I...
I have a while loop that counts backwards in a seriescollection to find the last value with data. In one particular case, I had to use an IF formula in the source data where it would output NA() if the statment was false, so instead of loop through empty strings until the loop finds a number, it...
As I have just found out I don't think it's possible to nest Dir loops. Current code:
sFile_1= Dir(sPath_Internal & "*.xls")
While sFile_1<> ""
...
sFile_2= Dir(sFile_1_variable & "*.xls")
While sFile_2<> ""
...
sFile_2= Dir
sFile_1= Dir
Is...
We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel
Which adblocker are you using?
Disable AdBlock
Follow these easy steps to disable AdBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the icon in the browser’s toolbar. 2)Click on the "Pause on this site" option.
Go back
Disable AdBlock Plus
Follow these easy steps to disable AdBlock Plus
1)Click on the icon in the browser’s toolbar. 2)Click on the toggle to disable it for "mrexcel.com".
Go back
Disable uBlock Origin
Follow these easy steps to disable uBlock Origin
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.
Go back
Disable uBlock
Follow these easy steps to disable uBlock
1)Click on the icon in the browser’s toolbar. 2)Click on the "Power" button. 3)Click on the "Refresh" button.