VBA Run-time Error 1004: "Application-defined or object-defined error"
VBA Run-time Error 1004: "Application-defined or object-defined error"
VBA Run-time Error 1004: "Application-defined or object-defined error"
VBA Run-time Error 1004: "Application-defined or object-defined error"
VBA Run-time Error 1004: "Application-defined or object-defined error"
VBA Run-time Error 1004: "Application-defined or object-defined error" VBA Run-time Error 1004: "Application-defined or object-defined error" VBA Run-time Error 1004: "Application-defined or object-defined error" VBA Run-time Error 1004: "Application-defined or object-defined error" VBA Run-time Error 1004: "Application-defined or object-defined error" VBA Run-time Error 1004: "Application-defined or object-defined error" VBA Run-time Error 1004: "Application-defined or object-defined error" VBA Run-time Error 1004: "Application-defined or object-defined error"
VBA Run-time Error 1004: "Application-defined or object-defined error" VBA Run-time Error 1004: "Application-defined or object-defined error"
VBA Run-time Error 1004: "Application-defined or object-defined error"
Go Back  Xtreme Visual Basic Talk > > > VBA Run-time Error 1004: "Application-defined or object-defined error"


Reply
 
Thread Tools Display Modes
  #1  
Old 08-13-2012, 11:38 AM
akaron akaron is offline
Newcomer
 
Join Date: Aug 2012
Posts: 1
Default VBA Run-time Error 1004: "Application-defined or object-defined error"


Hi,

I'm new to VB and I wasn't quite sure where to put this question, but here goes:

This macro is supposed to select a cell (given to the macro from a form I made), select to the bottom of the entries, cut the selection, and paste it one row down. I recorded a macro and was manipulating it to fit my purposes. Here is the code:
Code:
Sub MoveDown()
' MoveDown Macro
    Dim CutAddress, InsertAddress As Range
    
    Worksheets("Sheet1").Activate
    Dim CutRow As Integer
    CutRow = Val(FrmChooseCell.txtCellInsert.Value)
    Set CutAddress = ActiveSheet.Cells(0, CutRow)
    Set InsertAddress = ActiveSheet.Cells(0, CutRow + 1)
    CutAddress.Select
    Range(Selection, Selection.End(xlDown)).Select
    Range(Selection, Selection.End(xlToRight)).Select
    Selection.Cut
    InsertAddress.Select
    ActiveSheet.Paste
End Sub
I'm getting an "application-defined or object-defined error" at this line "Set CutAddress = ActiveSheet.Cells(0, CutRow)". Can anyone explain to me where I'm going wrong??
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
VBA Run-time Error 1004: "Application-defined or object-defined error"
VBA Run-time Error 1004: "Application-defined or object-defined error"
VBA Run-time Error 1004: "Application-defined or object-defined error" VBA Run-time Error 1004: "Application-defined or object-defined error"
VBA Run-time Error 1004: "Application-defined or object-defined error"
VBA Run-time Error 1004: "Application-defined or object-defined error"
VBA Run-time Error 1004: "Application-defined or object-defined error" VBA Run-time Error 1004: "Application-defined or object-defined error" VBA Run-time Error 1004: "Application-defined or object-defined error" VBA Run-time Error 1004: "Application-defined or object-defined error" VBA Run-time Error 1004: "Application-defined or object-defined error" VBA Run-time Error 1004: "Application-defined or object-defined error" VBA Run-time Error 1004: "Application-defined or object-defined error"
VBA Run-time Error 1004: "Application-defined or object-defined error"
VBA Run-time Error 1004: "Application-defined or object-defined error"
 
VBA Run-time Error 1004: "Application-defined or object-defined error"
VBA Run-time Error 1004: "Application-defined or object-defined error"
 
-->