VBA physical memory

bsquad

Board Regular
Joined
Mar 15, 2016
Messages
194
Looking for insight on if physical memory (or CPU or RAM) could effect Macro accuracy (not speed). As far as my research online goes and with my background the answer is no. However I have tried multiple versions of this chunk of code, it rarely works intermittently when ran as a whole but when I run it in F8 / step by step / break mode it works. The code is not that complicated but I have tried everything I could think of and something physical is the only thing I could think of.

I run a pretty standard issue 32bit ThinkPad, but to note - I am running at 95% physical memory just idling, my IT dept is going to end up reimaging to a 64.


the scenario is I have multiple sheets from other workbooks - but for this example I will only use 2 of them.
--2 sheets from one other workbook being imported to 2 sheets on the target workbook, I am copying and pasting two different areas on each sheet.
--the problem I am running into is the pasting ranges aren't correct they should be pasting on the last used column.


one version

Code:
'                                ImportWorkbook.Worksheets(3).Range("B25:E59").Copy
'                                LR = Cells(29, Columns.Count).SpecialCells(xlCellTypeLastCell).Column + 1
'                                    MasterWorkbook.Sheets(3).Cells(25, LR).PasteSpecial Paste:=xlPasteAll, operation:=xlNone, SkipBlanks:=False, _
'                                                    Transpose:=False
'                                    ImportWorkbook.Application.CutCopyMode = False
'
'                                ImportWorkbook.Worksheets(4).Range("B25:E59").Copy
'                                LR = Cells(29, Columns.Count).End(xlToLeft).Column + 1
'                                    MasterWorkbook.Worksheets(4).Cells(25, LR).PasteSpecial Paste:=xlPasteAll, operation:=xlNone, SkipBlanks:=False, _
'                                                    Transpose:=False
'                                    ImportWorkbook.Application.CutCopyMode = False


another version

Code:
                                ImportWorkbook.Worksheets(3).Range("B25:E59").Copy
                                    Dim xi As Long
                                    xi = Cells(29, Columns.Count).End(xlToLeft).Column + 1
                                    With MasterWorkbook.Worksheets(3)
                                        .Cells(25, xi).PasteSpecial Paste:=xlPasteAll
                                    End With
                                    ImportWorkbook.Application.CutCopyMode = False
                                    
                                ImportWorkbook.Worksheets(3).Range("b25:e59").Copy
                                    Dim xx As Long
                                    xx = Cells(29, Columns.Count).End(xlToLeft).Column + 1
                                    With MasterWorkbook.Worksheets(4)
                                        .Cells(25, xx).PasteSpecial Paste:=xlPasteAll
                                    End With
                                    ImportWorkbook.Worksheets(3).Application.CutCopyMode = False
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
I would add another LR range "LR2" use one for sheet three and the other for sheet 4
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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