Consulting

Results 1 to 3 of 3

Thread: Intellisense working Sporadically

  1. #1
    VBAX Regular
    Joined
    Feb 2018
    Location
    Portland
    Posts
    38
    Location

    Intellisense working Sporadically

    Hello,

    I have yet to figure out why the intellisense works just fine for writing code then stops working. Let me be more specific. In the block of code below, I get the intellisense for the line of code:
    Set sheetArray = ActiveWindow.SelectedSheets

    but not for this line of code:
    Worksheets("Summary").Range("A3").CurrentRegion

    Please see the screen captures below the code block.

    This happens frequently and on different PC's so am just trying to figure out the logic as to when it works and when it doesn't. Thanks for any tips


    Sub SingleActionWhenLoopingThroughSelectedSheets()
    
    Dim ws As Worksheet
    Dim sheetArray As Variant
    Dim myPassword As Variant
    Dim EmptyRow As Long
    
    'Clear data from Summary worksheet
    Worksheets("Summary").Range("A3").CurrentR
    
    'Capture the selected sheets
    Set sheetArray = ActiveWindow.sel
    
    'Loop through each selected worksheet
        For Each ws In sheetArray
            'Determine emptyRow
            EmptyRow = WorksheetFunction.CountA(Worksheets("Summary").Range("A:A")) + 2
            'Select the worksheet
            ws.Range("A3").CurrentRegion.Copy Worksheets("Summary").Cells(EmptyRow, 1)
        Next ws
    
    'Select the Summary Sheet
    Worksheets("Summary").Activate
    
    End Sub

    No_Intellisense.jpg

  2. #2
    VBAX Regular
    Joined
    Feb 2018
    Location
    Portland
    Posts
    38
    Location
    My complete code block is actually this:
    Sub SingleActionWhenLoopingThroughSelectedSheets()
    
    Dim ws As Worksheet
    Dim sheetArray As Variant
    Dim myPassword As Variant
    Dim EmptyRow As Long
    
    'Clear data from Summary worksheet
    Worksheets("Summary").Range("A3").CurrentRegion.Clear
    
    'Capture the selected sheets
    Set sheetArray = ActiveWindow.SelectedSheets
    
    'Loop through each selected worksheet
        For Each ws In sheetArray
            'Determine emptyRow
            EmptyRow = WorksheetFunction.CountA(Worksheets("Summary").Range("A:A")) + 2
            'Select the worksheet
            ws.Range("A3").CurrentRegion.Copy Worksheets("Summary").Cells(EmptyRow, 1)
        Next ws
    
    'Select the Summary Sheet
    Worksheets("Summary").Activate
    
    End Sub

  3. #3
    VBAX Regular
    Joined
    Feb 2018
    Location
    Portland
    Posts
    38
    Location
    Any ideas on why intellisense is "hit or miss" in above code? Not critical I know but would be nice to be able to give co-workers an explanation. Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •