Need help with VBA code prompting Compile error: Next without For

Pi_Lover

Board Regular
Joined
Nov 3, 2023
Messages
55
Office Version
  1. 365
Platform
  1. Windows
Good morning. I have some VBA code in a UserForm to execute when a CommandButton is clicked. I had the original code only looking in the worksheet Index in one column (AH) to find any value >0 to then look in the same row column AE and copy and paste the values into worksheet Qtrax_Update_Sheet. Column AE value would be pasted in column A in the first row available starting at the second row, and then the value in column H would be pasted into the column array (B:H) depending on what day it is. Column B being Monday and column H being Sunday. The next step in the code would then delete all the values >0 in column AH in the original worksheet Index and all the values pasted to the new worksheet Qtrax_Update_Sheet would then populate a ListBoxQTRAX. It functioned correctly when the code only included the beforementioned columns iin worksheet Index. Now that I added the rest of the columns for it to perform the same exercise on, it is prompting a Complie error: Next without For error. Can someone take a look at my code and see what the issue may be please? I can upload a link to Dropbox for you to work with it, if need be. See code below:

VBA Code:
Private Sub CommandButtonUpdateList_Click()
    Dim wsIndex As Worksheet
    Dim wsQTRAX As Worksheet
    Dim lastRow As Long
    Dim i As Long
    Dim dayOfWeek As Integer
    Dim targetColumn As Integer
    Dim colHeaders As Variant
    Dim dataRange As Range
    Dim combinedData As Variant
    Dim j As Long
    
    ' Set references to worksheets
    Set wsIndex = ThisWorkbook.Sheets("Index")
    Set wsQTRAX = ThisWorkbook.Sheets("QTRAX_Update_Sheet")
    
    ' Find the last row in the Index sheet
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "AH").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "AS").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "BD").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "BO").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "BZ").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "CK").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "CV").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "DG").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "DR").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "EC").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "EN").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "EY").End(xlUp).Row
    
    ' Determine the day of the week (1 = Sunday, 2 = Monday, ..., 7 = Saturday)
    dayOfWeek = Weekday(Date, vbMonday) ' Use vbMonday to start with Monday
    
    ' Calculate the target column in QTRAX_Update_Sheet
    targetColumn = dayOfWeek + 1 ' Add 1 to skip column A (AE value)
    
    ' Loop through rows in Index sheet
    For i = 2 To lastRow
        ' Check if value in column AH is greater than 0
        If wsIndex.Cells(i, "AH").Value > 0 Then
        If wsIndex.Cells(i, "AS").Value > 0 Then
        If wsIndex.Cells(i, "BD").Value > 0 Then
        If wsIndex.Cells(i, "BO").Value > 0 Then
        If wsIndex.Cells(i, "BZ").Value > 0 Then
        If wsIndex.Cells(i, "CK").Value > 0 Then
        If wsIndex.Cells(i, "CV").Value > 0 Then
        If wsIndex.Cells(i, "DG").Value > 0 Then
        If wsIndex.Cells(i, "DR").Value > 0 Then
        If wsIndex.Cells(i, "EC").Value > 0 Then
        If wsIndex.Cells(i, "EN").Value > 0 Then
        If wsIndex.Cells(i, "EY").Value > 0 Then
        
            ' Copy value from column AE in Index sheet
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "AE").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "AP").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "BA").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "BL").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "BW").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "CH").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "CS").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "DD").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "DO").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "DZ").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "EK").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "EV").Value
            
            ' Paste value in the appropriate column in QTRAX_Update_Sheet
            wsQTRAX.Cells(i, targetColumn).Value = wsIndex.Cells(i, "AH").Value
            wsQTRAX.Cells(i, targetColumn).Value = wsIndex.Cells(i, "AS").Value
            wsQTRAX.Cells(i, targetColumn).Value = wsIndex.Cells(i, "BD").Value
            wsQTRAX.Cells(i, targetColumn).Value = wsIndex.Cells(i, "BO").Value
            wsQTRAX.Cells(i, targetColumn).Value = wsIndex.Cells(i, "BZ").Value
            wsQTRAX.Cells(i, targetColumn).Value = wsIndex.Cells(i, "CK").Value
            wsQTRAX.Cells(i, targetColumn).Value = wsIndex.Cells(i, "CV").Value
            wsQTRAX.Cells(i, targetColumn).Value = wsIndex.Cells(i, "DG").Value
            wsQTRAX.Cells(i, targetColumn).Value = wsIndex.Cells(i, "DR").Value
            wsQTRAX.Cells(i, targetColumn).Value = wsIndex.Cells(i, "EC").Value
            wsQTRAX.Cells(i, targetColumn).Value = wsIndex.Cells(i, "EN").Value
            wsQTRAX.Cells(i, targetColumn).Value = wsIndex.Cells(i, "EY").Value
            
            ' Delete value in column AH
            wsIndex.Cells(i, "AH").Value = ""
            wsIndex.Cells(i, "AS").Value = ""
            wsIndex.Cells(i, "BD").Value = ""
            wsIndex.Cells(i, "BO").Value = ""
            wsIndex.Cells(i, "BZ").Value = ""
            wsIndex.Cells(i, "CK").Value = ""
            wsIndex.Cells(i, "CV").Value = ""
            wsIndex.Cells(i, "DG").Value = ""
            wsIndex.Cells(i, "DR").Value = ""
            wsIndex.Cells(i, "EC").Value = ""
            wsIndex.Cells(i, "EN").Value = ""
            wsIndex.Cells(i, "EY").Value = ""
        End If
    Next i
    
    ' Populate listboxQTRAX with column headers from row 1 in QTRAX_Update_Sheet
    colHeaders = wsQTRAX.Range("A1:H1").Value
    
    ' Populate the values below the headings
    Set dataRange = wsQTRAX.Range("A2:H" & lastRow)
    
    ' Combine headers and data into a single array
    ReDim combinedData(1 To lastRow, 1 To 8)
    For j = 1 To 8
        combinedData(1, j) = colHeaders(1, j)
    Next j
    For i = 2 To lastRow
        For j = 1 To 8
            combinedData(i, j) = dataRange.Cells(i - 1, j).Value
        Next j
    Next i
    
    ' Assign the combined data to the listbox
    Me.ListBoxQTRAX.ColumnCount = 8
    Me.ListBoxQTRAX.List = combinedData
    
    ' Set individual column widths (adjust as needed)
    Me.ListBoxQTRAX.ColumnWidths = "40;38;38;52;47;32;40;42"
End Sub
 
If you want the exact same thing to happen in each case, if at least one of those cells has a value greater than zero, then I think you should only need one IF...THEN, i.e
VBA Code:
    If (wsIndex.Cells(i, "AH").Value > 0) _
        Or (wsIndex.Cells(i, "AS").Value > 0) _
        Or (wsIndex.Cells(i, "BD").Value > 0) _
        Or (wsIndex.Cells(i, "BO").Value > 0) _
        Or (wsIndex.Cells(i, "BZ").Value > 0) _
        Or (wsIndex.Cells(i, "CK").Value > 0) _
        Or (wsIndex.Cells(i, "CV").Value > 0) _
        Or (wsIndex.Cells(i, "DG").Value > 0) _
        Or (wsIndex.Cells(i, "DR").Value > 0) _
        Or (wsIndex.Cells(i, "EC").Value > 0) _
        Or (wsIndex.Cells(i, "EN").Value > 0) _
        Or (wsIndex.Cells(i, "EY").Value > 0) Then
Then you would only one one END IF.
I modified the code to mirror what you provided and it gave me a compile error: Syntax error and then highlighted what was modified. Any idea on why?
 
Upvote 0

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
OK, I think we need to take a step back here. There are numerous issue with your code.
I also just noticed this here:
VBA Code:
    ' Find the last row in the Index sheet
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "AH").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "AS").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "BD").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "BO").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "BZ").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "CK").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "CV").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "DG").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "DR").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "EC").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "EN").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "EY").End(xlUp).Row
which is pointless, because each calculation of "lastRow" overwrites the value from the previous, so all that you are really left with is:
VBA Code:
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "EY").End(xlUp).Row

It appears that maybe you took some code that was designed for one column/value and tried to extend it for multiple ones, but butchered the code pretty good in the process.

Rather than trying to fix up code that has a lot of issues, it would probably be better if you should us some sample data, and just explained in plain English exactly what it is that you are trying to do (in relation to that data sample). I am a very visual person, so having an explanation without seeing the data is not all that helpful to me.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
OK, i have rewrote some of the code, and it has progressed me a slight bit further, but it is not executing exactly how I want it to. See code below:

VBA Code:
Private Sub CommandButtonUpdateList_Click()
    Dim wsIndex As Worksheet
    Dim wsQTRAX As Worksheet
    Dim lastRow As Long
    Dim i As Long
    Dim dayOfWeek As Integer
    Dim targetColumn As Integer
    Dim columnsToCheck As Variant
    Dim col As Long
    Dim valueFound As Boolean
    Dim newRow As Long
    Dim colHeaders As Variant
    Dim dataRange As Range
    Dim combinedData() As Variant
    Dim j As Long
    
    ' Set references to worksheets
    Set wsIndex = ThisWorkbook.Sheets("Index")
    Set wsQTRAX = ThisWorkbook.Sheets("QTRAX_Update_Sheet")
    
    ' Define the columns to check
    columnsToCheck = Array("AH", "AS", "BD", "BO", "BZ", "CK", "CV", "DG", "DR", "EC", "EN", "EY")
    
    ' Find the last row in the Index sheet (assuming all columns have the same last row)
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "AH").End(xlUp).Row
    
    ' Determine the day of the week (1 = Sunday, 2 = Monday, ..., 7 = Saturday)
    dayOfWeek = Weekday(Date, vbMonday) ' Use vbMonday to start with Monday
    
    ' Calculate the target column in QTRAX_Update_Sheet
    targetColumn = dayOfWeek + 1 ' Add 1 to skip column A (AE value)
    
    ' Find the next available row in column A of QTRAX_Update_Sheet
    newRow = wsQTRAX.Cells(wsQTRAX.Rows.Count, 1).End(xlUp).Row + 1
    
    ' Loop through rows
    For i = 2 To lastRow
        valueFound = False ' Initialize flag for each row
        
        ' Check if any value in the specified columns is greater than 0
        For col = LBound(columnsToCheck) To UBound(columnsToCheck)
            If wsIndex.Cells(i, columnsToCheck(col)).Value > 0 Then
            ' Copy values from associated columns in Index sheet
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "AE").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "AP").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "BA").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "BL").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "BW").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "CH").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "CS").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "DD").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "DO").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "DZ").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "EK").Value
            wsQTRAX.Cells(i, 1).Value = wsIndex.Cells(i, "EV").Value
            
            ' Paste value in the appropriate column in QTRAX_Update_Sheet
            wsQTRAX.Cells(newRow, targetColumn).Value = wsIndex.Cells(i, columnsToCheck(col)).Value
            wsQTRAX.Cells(newRow, targetColumn).Value = wsIndex.Cells(i, columnsToCheck(col)).Value
            wsQTRAX.Cells(newRow, targetColumn).Value = wsIndex.Cells(i, columnsToCheck(col)).Value
            wsQTRAX.Cells(newRow, targetColumn).Value = wsIndex.Cells(i, columnsToCheck(col)).Value
            wsQTRAX.Cells(newRow, targetColumn).Value = wsIndex.Cells(i, columnsToCheck(col)).Value
            wsQTRAX.Cells(newRow, targetColumn).Value = wsIndex.Cells(i, columnsToCheck(col)).Value
            wsQTRAX.Cells(newRow, targetColumn).Value = wsIndex.Cells(i, columnsToCheck(col)).Value
            wsQTRAX.Cells(newRow, targetColumn).Value = wsIndex.Cells(i, columnsToCheck(col)).Value
            wsQTRAX.Cells(newRow, targetColumn).Value = wsIndex.Cells(i, columnsToCheck(col)).Value
            wsQTRAX.Cells(newRow, targetColumn).Value = wsIndex.Cells(i, columnsToCheck(col)).Value
            wsQTRAX.Cells(newRow, targetColumn).Value = wsIndex.Cells(i, columnsToCheck(col)).Value
            wsQTRAX.Cells(newRow, targetColumn).Value = wsIndex.Cells(i, columnsToCheck(col)).Value
            
            ' Increment the new row counter
            newRow = newRow + 1
        End If
      Next col
    Next i
    
    ' Clear values in the specified columns of the Index sheet
    For col = LBound(columnsToCheck) To UBound(columnsToCheck)
        wsIndex.Range(columnsToCheck(col) & "2:" & columnsToCheck(col) & lastRow).ClearContents
    Next col
    
    ' Populate listboxQTRAX with column headers from row 1 in QTRAX_Update_Sheet
    colHeaders = wsQTRAX.Range("A1:H1").Value
    
    ' Populate the values below the headings
    Set dataRange = wsQTRAX.Range("A2:H" & lastRow)
    
    ' Combine headers and data into a single array
    ReDim combinedData(1 To lastRow, 1 To 8)
    For j = 1 To 8
        combinedData(1, j) = colHeaders(1, j)
    Next j
    For i = 2 To lastRow
        For j = 1 To 8
            combinedData(i, j) = dataRange.Cells(i - 1, j).Value
        Next j
    Next i
    
    ' Assign the combined data to the listbox
    Me.ListBoxQTRAX.ColumnCount = 8
    Me.ListBoxQTRAX.List = combinedData
    
    ' Set individual column widths (adjust as needed)
    Me.ListBoxQTRAX.ColumnWidths = "40;38;38;52;47;32;40;42"
    End Sub
 
Upvote 0
I've tried every method mentioned in the article to download XL22B add in, but I am not having any luck. Not sure if it is due to this being a company laptop that may not allow it
 
Upvote 0
OK, I think we need to take a step back here. There are numerous issue with your code.
I also just noticed this here:
VBA Code:
    ' Find the last row in the Index sheet
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "AH").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "AS").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "BD").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "BO").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "BZ").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "CK").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "CV").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "DG").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "DR").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "EC").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "EN").End(xlUp).Row
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "EY").End(xlUp).Row
which is pointless, because each calculation of "lastRow" overwrites the value from the previous, so all that you are really left with is:
VBA Code:
    lastRow = wsIndex.Cells(wsIndex.Rows.Count, "EY").End(xlUp).Row

It appears that maybe you took some code that was designed for one column/value and tried to extend it for multiple ones, but butchered the code pretty good in the process.

Rather than trying to fix up code that has a lot of issues, it would probably be better if you should us some sample data, and just explained in plain English exactly what it is that you are trying to do (in relation to that data sample). I am a very visual person, so having an explanation without seeing the data is not all that helpful to me.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
I've tried every method in the article to download XL22B, but I am having no luck. Not sure if it has anything to do with this being a company laptop that may be blocking it. I will attempt to install it on my personal laptop when I get home this evening.
 
Upvote 0
I've tried every method in the article to download XL22B, but I am having no luck. Not sure if it has anything to do with this being a company laptop that may be blocking it. I will attempt to install it on my personal laptop when I get home this evening.
I found the solution. Cleaned up the code and it works like a charm now

VBA Code:
Private Sub CommandButtonUpdateList_Click()
    Dim wsIndex As Worksheet
    Dim wsUpdate As Worksheet
    Dim searchCols As Variant
    Dim valueCols As Variant
    Dim lastRow As Long
    Dim i As Long, j As Long
    Dim dayOfWeek As Integer
    Dim searchValue As Variant
    Dim valueToCopy As Variant
    Dim updateRow As Long
    Dim colHeaders As Variant
    Dim dataRange As Range
    Dim combinedData() As Variant

    ' Set worksheets
    Set wsIndex = ThisWorkbook.Sheets("Index")
    Set wsUpdate = ThisWorkbook.Sheets("Qtrax_Update_Sheet")

    ' Define column arrays
    searchCols = Array("AH", "AS", "BD", "BO", "BZ", "CK", "CV", "DG", "DR", "EC", "EN", "EY")
    valueCols = Array("AE", "AP", "BA", "BL", "BW", "CH", "CS", "DD", "DO", "DZ", "EK")

    ' Get the current day of the week (1=Monday, 7=Sunday)
    dayOfWeek = Weekday(Date, vbMonday)

    ' Initialize the row for updating Qtrax_Update_Sheet
    updateRow = 2

    ' Loop through each search column
    For i = LBound(searchCols) To UBound(searchCols)
        ' Find the last row with data in the current search column
        lastRow = wsIndex.Cells(wsIndex.Rows.Count, searchCols(i)).End(xlUp).Row

        ' Loop through each row in the current search column
        For j = 2 To lastRow
            searchValue = wsIndex.Cells(j, searchCols(i)).Value
            If searchValue > 0 Then
                ' Ensure the value column index is within bounds
                If i <= UBound(valueCols) Then
                    ' Copy the value from the corresponding value column
                    valueToCopy = wsIndex.Cells(j, valueCols(i)).Value
                    wsUpdate.Cells(updateRow, "A").Value = valueToCopy

                    ' Copy the search value to the appropriate column based on the day of the week
                    wsUpdate.Cells(updateRow, dayOfWeek + 1).Value = searchValue

                    ' Move to the next row in Qtrax_Update_Sheet
                    updateRow = updateRow + 1
                End If
            End If
        Next j
    Next i
    
    ' Clear values in the specified columns of the Index sheet from row 2 down
    For col = LBound(searchCols) To UBound(searchCols)
        lastRow = wsIndex.Cells(wsIndex.Rows.Count, searchCols(col)).End(xlUp).Row
        wsIndex.Range(searchCols(col) & "2:" & searchCols(col) & lastRow).ClearContents
    Next col
    
    ' Find the last row with data in the Qtrax_Update_Sheet
    lastRow = wsUpdate.Cells(wsUpdate.Rows.Count, "A").End(xlUp).Row
    
    ' Populate listboxQTRAX with column headers from row 1 in QTRAX_Update_Sheet
    colHeaders = wsUpdate.Range("A1:H1").Value
    
    ' Populate the values below the headings
    Set dataRange = wsUpdate.Range("A2:H" & lastRow)
    
    ' Combine headers and data into a single array
    ReDim combinedData(1 To lastRow, 1 To 8)
    For j = 1 To 8
        combinedData(1, j) = colHeaders(1, j)
    Next j
    For i = 2 To lastRow
        For j = 1 To 8
            combinedData(i, j) = dataRange.Cells(i - 1, j).Value
        Next j
    Next i
    
    ' Assign the combined data to the listbox
    Me.ListBoxQTRAX.ColumnCount = 8
    Me.ListBoxQTRAX.List = combinedData
    
    ' Set individual column widths (adjust as needed)
    Me.ListBoxQTRAX.ColumnWidths = "40;38;38;52;47;32;40;42"
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

We've detected that you are using an adblocker.

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.
Go back
Back
Top