Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default Application defined error

I have a macro to copy info from one sheet and paste it into selected blank
cells on another sheet. It should work, but the application error indicates
there's something wrong with: Worksheets("Field Activity
Report").Cells(BlankCell,4).Select

Here's the macro:
Sub CopyRetailerInfo()
Dim BlankCell As Integer

Range(ActiveCell, ActiveCell.Offset(0, 4)).Copy
Worksheets("Field Activity Report").Select
BlankCell = Application.WorksheetFunction.CountA(Worksheets("F ield Activity
Report").Range("D:D")) = 1
Worksheets("Field Activity Report").Cells(BlankCell, 4).Select
Selection.PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Worksheets("Survey Spreadsheet").Select

End Sub

Any guidance would certainly be appreciated. Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default Application defined error

You have not explained the actual error you are getting. However, add the
following line before the line you are getting the error in and it might work.

Worksheets("Field Activity Report").Activate

Alok Joshi

"Larry" wrote:

I have a macro to copy info from one sheet and paste it into selected blank
cells on another sheet. It should work, but the application error indicates
there's something wrong with: Worksheets("Field Activity
Report").Cells(BlankCell,4).Select

Here's the macro:
Sub CopyRetailerInfo()
Dim BlankCell As Integer

Range(ActiveCell, ActiveCell.Offset(0, 4)).Copy
Worksheets("Field Activity Report").Select
BlankCell = Application.WorksheetFunction.CountA(Worksheets("F ield Activity
Report").Range("D:D")) = 1
Worksheets("Field Activity Report").Cells(BlankCell, 4).Select
Selection.PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Worksheets("Survey Spreadsheet").Select

End Sub

Any guidance would certainly be appreciated. Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default Application defined error

The popup box reads: Run-time error '1004'. Application-defined or
object-defined error. When I click on 'debug' , that one line is
highlighted. Thanks.

"Alok" wrote:

You have not explained the actual error you are getting. However, add the
following line before the line you are getting the error in and it might work.

Worksheets("Field Activity Report").Activate

Alok Joshi

"Larry" wrote:

I have a macro to copy info from one sheet and paste it into selected blank
cells on another sheet. It should work, but the application error indicates
there's something wrong with: Worksheets("Field Activity
Report").Cells(BlankCell,4).Select

Here's the macro:
Sub CopyRetailerInfo()
Dim BlankCell As Integer

Range(ActiveCell, ActiveCell.Offset(0, 4)).Copy
Worksheets("Field Activity Report").Select
BlankCell = Application.WorksheetFunction.CountA(Worksheets("F ield Activity
Report").Range("D:D")) = 1
Worksheets("Field Activity Report").Cells(BlankCell, 4).Select
Selection.PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Worksheets("Survey Spreadsheet").Select

End Sub

Any guidance would certainly be appreciated. Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default Application defined error

This error will happen when BlankCell variable has a value of 0 as you are
then accessing a cell in row 0. This will happen if there is nothing in the
D:D range. Just check why that is happening.

Alok Joshi

"Larry" wrote:

The popup box reads: Run-time error '1004'. Application-defined or
object-defined error. When I click on 'debug' , that one line is
highlighted. Thanks.

"Alok" wrote:

You have not explained the actual error you are getting. However, add the
following line before the line you are getting the error in and it might work.

Worksheets("Field Activity Report").Activate

Alok Joshi

"Larry" wrote:

I have a macro to copy info from one sheet and paste it into selected blank
cells on another sheet. It should work, but the application error indicates
there's something wrong with: Worksheets("Field Activity
Report").Cells(BlankCell,4).Select

Here's the macro:
Sub CopyRetailerInfo()
Dim BlankCell As Integer

Range(ActiveCell, ActiveCell.Offset(0, 4)).Copy
Worksheets("Field Activity Report").Select
BlankCell = Application.WorksheetFunction.CountA(Worksheets("F ield Activity
Report").Range("D:D")) = 1
Worksheets("Field Activity Report").Cells(BlankCell, 4).Select
Selection.PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Worksheets("Survey Spreadsheet").Select

End Sub

Any guidance would certainly be appreciated. Thanks!

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 159
Default Application defined error

Found it! Thanks!

"Alok" wrote:

This error will happen when BlankCell variable has a value of 0 as you are
then accessing a cell in row 0. This will happen if there is nothing in the
D:D range. Just check why that is happening.

Alok Joshi

"Larry" wrote:

The popup box reads: Run-time error '1004'. Application-defined or
object-defined error. When I click on 'debug' , that one line is
highlighted. Thanks.

"Alok" wrote:

You have not explained the actual error you are getting. However, add the
following line before the line you are getting the error in and it might work.

Worksheets("Field Activity Report").Activate

Alok Joshi

"Larry" wrote:

I have a macro to copy info from one sheet and paste it into selected blank
cells on another sheet. It should work, but the application error indicates
there's something wrong with: Worksheets("Field Activity
Report").Cells(BlankCell,4).Select

Here's the macro:
Sub CopyRetailerInfo()
Dim BlankCell As Integer

Range(ActiveCell, ActiveCell.Offset(0, 4)).Copy
Worksheets("Field Activity Report").Select
BlankCell = Application.WorksheetFunction.CountA(Worksheets("F ield Activity
Report").Range("D:D")) = 1
Worksheets("Field Activity Report").Cells(BlankCell, 4).Select
Selection.PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Worksheets("Survey Spreadsheet").Select

End Sub

Any guidance would certainly be appreciated. Thanks!



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time error '50290': Application-defined or object-defined erro Macro button Excel Discussion (Misc queries) 1 March 12th 09 10:59 AM
Macro error : Application-defined or object-defined error Joe Excel Discussion (Misc queries) 3 January 27th 06 02:32 PM
Macro Run-time Error 1004 Application Defined or Object Defined Error Anddmx Excel Programming 6 June 9th 04 03:40 PM
Runtime Error 1004 -- Application Defined or Object Defined Error John[_51_] Excel Programming 3 September 4th 03 04:28 PM


All times are GMT +1. The time now is 06:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"