OzGrid Forum
536 FOLLOWERS
OzGrid is the best online resource for all your Excel & VBA requirements. Ask questions related to the use of excel formulas, gain insight into the efficiency and best practice when coding, share your working code for others to review and critique and find solutions for integrating excel with other applications with advanced technologies.
OzGrid Forum
2d ago
Accessing your worksheet multiple times makes the process slow and inefficient, it is much better to use a matrix method.
Dim a, i&
a = [a1:a10000]
For i = 1 To UBound(a)
' Perform operations
Next i ..read more
OzGrid Forum
2d ago
You overwrite the last row with these lines:
Code
.Range("AD" & RepRow + LastExpRow - 1).Value = "TOTAL EXPENSES"
.Range("AE" & RepRow + LastExpRow - 1).Value = "=Sum(AE" & RepRow + 2 & ":AE" & RepRow + LastExpRow - 2 & ..read more
OzGrid Forum
1w ago
Adapting the code you found to what you describe needing will not in itself cause Excel to crash.
How is the value in F127 arrived at after the selection from the E4 drop-down ?
My suspicion is that the Worksheet_Change event might be used to fill F127
Right click on the sheet1 tab then View code
do you see any subs there ..read more
OzGrid Forum
2w ago
Goodnight
I come here to ask for help.
I intend that, when placing the data from cell C7 to cell E241, then by the number of times its name appears in Cell C7 to C241, it will be placed in descending order in cells M7 to M241.
I also want the number of times won to be entered in cell N7 to N241.
I want the money you won to be added up in cells O7 to O241.
I want cells L7 to O241 to be protected
Here are some details of what I want.
If you have any questions, please ask, as it may not be as clear as I intend.
Thanks
Best Regards ..read more
OzGrid Forum
2w ago
I have 2 sub routines & want to combine them into 1 sub routine. It can be done with goto statements & nests loops but i am unable to do it. Code perform family tree & align family members in order.
Code have 2 sub routines demo & getchild. My requirement is that both sub routines merged into single sub routine but i am unable to do it.
Kindly help in this regard dear community
Code is given below.
In the attachment, question is data given & answere is how data should be sorted.
Sub Demo()
Set nws = Worksheets("newsheet")
Dim i As Long, j As Long, objDic As Object
Dim arrDa ..read more
OzGrid Forum
2w ago
As I am not clear about what you want with the calendar on the userForm, I've set up a quick example workbook (attached) where a MsgBox loops through the E1:E11 range and lets you select on which cell you want to insert a date (in this case always the today date).
If you exchange the MsgBox with your userForm output, you should have what you need.
This is the updated code:
Code
Sub Date_Example()
Dim C As Range
' Application.ScreenUpdating = False
Range("E1:E11").Offset(1).ClearContents
DoEvents
For Each C In Range("E1:E11").Cells 'In this example, every cell in column E i ..read more
OzGrid Forum
2w ago
Hi All,
I'm currently working on tooling to move selected controls within a userForm in the VBE designer.
I am struggling to reference only the selected controls within a frame in VBA.
forum.ozgrid.com/index.php?attachment/1234777/
The code so far is:
Sub A_SelectedControlsHorizontal(Optional intVal As Integer)
Dim objC As control
Dim objCC As control
Dim strTmp As String
strTmp = InputBox("Give horizontal offset integer for selected controls.", "N pixels (+/-):", strTmp)
If strTmp = "" Then Exit Sub
intVal = CInt ..read more
OzGrid Forum
3w ago
Reg: Filtering 2nd row or anywhere on spreadsheet instead of 1st row
First select the row or cell where you want to use filter, then go to Data on the toolbar just click on it ..read more
OzGrid Forum
3w ago
ANAHEIM The Angels were being dealt a huge blow upon Wednesday, as 2-route celebrity Shohei Ohtani was identified with a torn ulnar collateral ligament inside his directly elbow soon after exiting his begin just after only 1 1/3 innings within a 9-4 reduction inside Activity 1 of a doubleheader versus the Reds. It's the minute period that Ohtani consists of experienced a torn UCL. He experienced the similar harm within 2018, and it pressured him toward endure Tommy John surgical treatment and not pitch inside 2019. The Angels, despite the fact that, are waiting around upon a minute viewpoint ..read more