Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
Anonymous
Not applicable

Data types

Hi,

 

I have a query that does the job. Problem is when i try to run VBA on it, i have a set of columns with one of them being formatted as text. I run a VBA module on it, that defines the range as long. However, one text column refuses to work on it and returns error 13 (type mismatch). 

 

The script is basicly .Cells(.Rows.Count,"A").End(xlUp).row, so im counting rows. Why is the text data type not working?

 

 

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi

Is this problem sloved? 

If it is sloved, could you kindly accept it as a solution to close this case?

If not, please let me know.

 

Best Regards

Maggie

v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

I'm not expert of VBA, as searched, there are some casues and solutions to this error:

https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/type-mismatch-err...

 

if you want to count the rows in Power Query, you could easily achieve as below:

Capture4.JPG

Or filter out null for a column and count based on the column

Capture5.JPG

 

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.