Macro & Recording data changes when Data exceeds 64 K I have recorded a macro fo
ID: 3563128 • Letter: M
Question
Macro & Recording data changes when Data exceeds 64 K
I have recorded a macro for my Excel sheets that I used for data entry.
I have one sheet where I enter all the data.
I then have that data sent to another sheet (Data) within the excel workbook. all the data is recorded on line "1" across the sheet. This data is then saved to line 10 by use of a macro via a button (Save data). This all works fine no issues.
However I have recorded a 2nd macro that will reload the data back on the sheet 1 Via line 6 on sheet "2"
The recording goes like
A6 Ctl C, Sheet1, cell, Ctl p.
the data recorded is in the same fashion for all 450 cells on line 6 in sheets 2
I then edit the macro in VBA by correctly all the unnecessary data that was recorded like the scroll parts
When I went to run the macro which is assigned to another button called "load data" an error message "Compiled data to large" exceeds 64K
So I have managed to break the data after around the 240 recorded entry. This is now obviously under the 64k of data & will load the data onto sheet1 as it should.
Now the where the break is on the first part where the "End Sub" everything after will not transfer, but I have done is managed to add another macro by adding another "Sub LoadVSIdata1() prior to the rest of the data.
Can anyone help with how to link the 2 macro together so they will work of the same button.
Sample of data is below
Sub LoadVISdata()
'
' LoadVISdata Macro
' Marco recorded 24-09-14 by Michael
'
Range("A6").Select
Selection.Copy
Sheets("VIS").Select
Range("B1").Select
ActiveSheet.Paste
Sheets("Data").Select
Range("B6").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("VIS").Select
Range("B2").Select
ActiveSheet.Paste
Sheets("Data").Select
Range("C6").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("VIS").Select
Range("B16:D16").Select
ActiveSheet.Paste
Sheets("Data").Select
Range("D6").Select
Sheets("Data").Select
Range("HA6").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("VIS").Select
Range("B110:F110").Select
ActiveSheet.Paste
End Sub
-----------------------------------------------------------------------------------------------------------------
Sub LoadVISdata1()
Sheets("Data").Select
Range("HB6").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("VIS").Select
Range("J114").Select
ActiveSheet.Paste
Continue on too:-
Sheets("Data").Select
Range("JW6").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("VIS").Select
Range("O6").Select
ActiveSheet.Paste
End Sub
All the above is Module 4 of my work sheet.
Explanation / Answer
Make the changes in LoadVISdata that I have highlighted in bold. Now clicking your button will run LoadVISdata first and then LoadVISdata1. Hope this helps solve your problem
Sub LoadVISdata()
'
' LoadVISdata Macro
' Marco recorded 24-09-14 by Michael
'
Range("A6").Select
Selection.Copy
Sheets("VIS").Select
Range("B1").Select
ActiveSheet.Paste
Sheets("Data").Select
Range("B6").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("VIS").Select
Range("B2").Select
ActiveSheet.Paste
Sheets("Data").Select
Range("C6").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("VIS").Select
Range("B16:D16").Select
ActiveSheet.Paste
Sheets("Data").Select
Range("D6").Select
Sheets("Data").Select
Range("HA6").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("VIS").Select
Range("B110:F110").Select
ActiveSheet.Paste
'my addition
Call LoadVISdata1
End Sub
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.