Form data transfer Error "Run-Time Error 1004 Application defined or object defined error"

AWood4081

New Member
Joined
Oct 21, 2020
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hello all,

VBA newbie here been reading thread after thread trying to solve the Run time error 1004 Applicatin-Defined or Object-defined error. Eveything i can see looks correct. I'm not sure what im missing in this data Entry Form. I keep getting stuck on the following Code:
nextRow = dataSheet.Range("A" & dataSheet.Rows.Count).End(x1Up).Offset(1).Row

Here is the rest of the code in its entirety:

Sub Store_Data()

Dim sourceSheet As Worksheet
Dim dataSheet As Worksheet
Dim nextRow As Integer

Set sourceSheet = Sheets("Form")
Set dataSheet = Sheets("Data")

nextRow = dataSheet.Range("A" & dataSheet.Rows.Count).End(x1Up).Offset(1).Row

dataSheet.Cells(nextRow, 1).Value = sourceSheet.Range("G5").Value
dataSheet.Cells(nextRow, 2).Value = sourceSheet.Range("M5").Value
dataSheet.Cells(nextRow, 3).Value = sourceSheet.Range("G7").Value
dataSheet.Cells(nextRow, 4).Value = sourceSheet.Range("M7").Value
dataSheet.Cells(nextRow, 5).Value = sourceSheet.Range("G9").Value
dataSheet.Cells(nextRow, 6).Value = sourceSheet.Range("M9").Value
dataSheet.Cells(nextRow, 7).Value = sourceSheet.Range("G11").Value
dataSheet.Cells(nextRow, 8).Value = sourceSheet.Range("M11").Value
dataSheet.Cells(nextRow, 9).Value = sourceSheet.Range("G13").Value
dataSheet.Cells(nextRow, 11).Value = sourceSheet.Range("M13").Value
dataSheet.Cells(nextRow, 10).Value = sourceSheet.Range("G15").Value


Thank you in advance for any help.
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi & welcome to MrExcel.
It should be xlUp (lower case L) not x1Up (number one)
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

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