Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 2nd, 2007, 06:18 AM
Registered User
 
Join Date: Mar 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Run time error 1004

Private Sub CommandButton2_Click()

Sheets("Score Card Calculator").Select
    Range("S31").Select
Sheets("ScoreRecords").Select
Range("S31").Select

End Sub

I know I'm a bit of a dunce at writing code, but the above is simple stuff, however I keep getting the error message.

Run time error 1004
Application defined or object defined error.

I just need to carry cell info on one sheet to a cell on another sheet??

Help


 
Old March 2nd, 2007, 06:30 AM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Ken

This error happens when there is no Workbook open in the XL application.

You can check using the following code

If ActiveWorkbook Is Nothing Then
    MsgBox "Macro will work on open workbooks!", vbInformation
    End
End If

Cheers,
Shasur

http://www.vbadud.blogspot.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
run-time error(s) Chacko C++ Programming 0 March 4th, 2007 02:28 PM
Run-time error '1004' Document not saved Tucky Excel VBA 0 October 28th, 2004 12:04 AM
Run-time error '1004': raja.gogoi VB Components 1 July 18th, 2004 11:02 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.