Linking Ecel to Access

  • Thread starter Thread starter sryan
  • Start date Start date
S

sryan

I am trying to transfer informtion in one sheet to another sheet in the
same workbook. I have a macro to process this information from the
first sheet to the second. I keep getting an error in this Process
macro at the line.
Application.Goto REFERENCE:=Range("END")

The first sheet is called ProblemSheet and the second sheet is called
Processed. The line above is taken from the process macro on the
ProblemSheet page. Do I have to name a certain cell as "END" on either
sheet? Any help with this would be really appreciated.
 
Sryan,

For Range("End") to work, there must be a range named End. If you want to
get to the end of a table, instead use something like:

Cells(Cells.Rows.Count, 1).End(xlUp).Offset(1, 0).Select
Cells(Cells.Rows.Count, 1).End(xlUp).Offset(1, 0) = MyData

Sheets("Sheet1").Range("A1").Copy _
Destination:=Sheets("Sheet2").Cells(Cells.Rows.Count,
1).End(xlUp).Offset(1, 0)

The last one will copy A1 from Sheet1 and paste it to the row under the last
data-containing cell in column 1 of Sheet 2.
 
Application.Goto REFERENCE:=Range("END") refers to a named range in the
currently active sheet. If it is not there you will get an error.

Better (still needing a named range) is something like :-
Application.Goto REFERENCE:=Worksheets("Sheet1").Range("END")
 
Back
Top