Forum

UsedRange giving co...
 
Notifications
Clear all

UsedRange giving conflicting values for different users

2 Posts
2 Users
0 Reactions
78 Views
(@johnm)
Posts: 7
Active Member
Topic starter
 

Hi all,

 

I need some troubleshooting help regarding a VBA module.

It's very simple code, which triggers the refresh of a report, counts the rows on the report and then copies it to a different tab - there's more before and after but this is the part causing issue:

 

Range("A6:A6").QueryTable.Refresh BackgroundQuery:=False

reportrows = Sheets("Amount").UsedRange.Rows.Count

I had a user reporting issues, and sat with them to understand. If we both perform the same query search, the query returns the same data, but on my computer the reportrows returns a different value to theirs. I,e mine shows as 10, and theirs shows 11, which impacts the subsequent processing.

 

We were using the same file, from the same network location, in Excel desktop app, both running same OS etc - although her laptop is slightly newer.

I can't for the life of me understand how hers is calculating the UsedRange.Rows.Count differently.

 

I've looked through documentation for the function but nothing to suggest why it's different. There's no extra data on the line, and multiple people use this code with no problem, only an issue on this 1 machine.....help?!

 
Posted : 28/09/2023 4:59 am
(@debaser)
Posts: 836
Member Moderator
Share: