PDA

View Full Version : Intellisense working Sporadically



ScottyBee
09-01-2020, 12:39 PM
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



27036

ScottyBee
09-01-2020, 12:47 PM
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

ScottyBee
09-03-2020, 11:46 AM
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