Quick macro help - paste values

theta

Well-known Member
Joined
Jun 9, 2009
Messages
960
Hi

I need to prevent numbers stored at text. At present I use

oWS.UsedRange.Values = oWS.UsedRange.Values

This was working fine but now runs out of memory as dealing with a huge range

Can this be changed so that it does the .Values = .Values for each column in the Usedrange...scrolling until the operation has completed for all columns. (For each Column in UsedRange - or use a counter with UsedRange.Columns.Count ?)

This should then fix the memory problem

(or maybe rng as Range - for each rng ?)

Any help appreciated

Kind regards
 
This is the row that gets highlighted

.Rows(1).AutoFilter

I can't see how our small change to the code has caused this much of an effect

Do I need to reset the UsedRange after the .Value method using Cols?
 
Last edited:
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Noticed that A:AD where the headers are form named range 'Table1'. If I select A:AE (1 extra column) - the autofilter option greys out?

Doesn't happen when just using UsedRange.Value = oWS.UsedRange.Value

?
 
Upvote 0
I said before : Error: 1004 AutoFilter method of Range class failed

Just had a look at the two outputs using the two methods

Using the fix - XML Data is clearly still a table (will not autofilter when the entire Rows(1) selected)

Original method - Plain data (no table - no named range table) - works when Rows(1) selected

Why are the two codes producing such different results? It was only split by columns...
 
Last edited:
Upvote 0
It's just confusing. Logically they appear to do the same thing in 2 different ways.

But UsedRange.Value = oWS.UsedRange.Value removes and table references

Any thoughts anybody else?

Thanks for all your help so far, been scratching my head for a fair while!?
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,850
Members
452,948
Latest member
UsmanAli786

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