excel


Excel Error 1004 when referencing ranges with VBA


Greetings Stack Overflow, so I've gone through a lot of potential solutions for this issue and ultimately am having an experience where no matter what sheet in my workbook i decide to reference I receive the Error 1004 message. This is getting rather frustrating and was wondering if anyone here may know what causes this.
'This subroutine will delete the old Report Worksheets and create the new ones which we will have the updated data on what was found.
Sub Create_ReportSheets()
Dim rPI As Range
Dim rFI As Range
Dim rUI As Range
Application.DisplayAlerts = False
On Error Resume Next
Sheets("Passed Inputs").Delete
Sheets("Failed Inputs").Delete
Sheets("Unmatched Inputs").Delete
Application.DisplayAlerts = True
On Error GoTo 0
'Add & Config the new "Pased Inputs" sheet.
Sheets.Add(After:=Sheets("Rule Tables")).Name = "Passed Inputs"
Set rPI = Sheets("Passed Inputs").Range("A0:B0")
The Line below is what is throwing the error. I've tried restarting excel and testing this in a new Workbook and have had no success. Previously lines that I've used to define ranges which run cannot be re executed elsewhere, if i try to copy them somewhere else it begins throwing this error.
Set rPI = Sheets("Passed Inputs").Range("A0:B0")
Instead of:
Set rPI = Sheets("Passed Inputs").Range("A0:B0")
Use:
Set rPI = Sheets("Passed Inputs").Range("A:B") to select the 2 complete columns.

Related Links

How to fill data in excel sheet where date lies between a series of date ranges given in another sheet ? Also, a particular column should match
Altering an If equation to include a qualifier
ActiveX Controls resize when Excel 2010 file is opened
Excel VBA - keep on using excel while having a userform loaded
Run-time error '1004' - Method 'Range' of object'_Global' failed while deleting rows
Is this still considered a valid CSV file?
Excel VBA Code for copying 3 columns from sheet2 to sheet1 by matching a date and time stamp
excel return the value of a cell based on two other values
access vba macro from outside the excel file
Sorting issue excel
How to merge two worksheets entirely — with varying spreadsheet names, format, and worksheet titles
Excel VBA Print multiple named range in seperate page of PDF
Count non blank rows in a certain range/column Excel
Excel SUMIFS function not returning results consistently
Txt imported table empty rows deletion
Starting cell for copying array

Categories

HOME
highcharts
amazon-dynamodb
luigi
bloomberg
ipad
visual-studio-mac
google-home
uiviewcontroller
64bit
timezone
outlook-addin
virtocommerce
soundcloud
spring-transactions
sorm
corba
m3u8
esapi
atlassian-sourcetree
beatbox
uidocumentinteraction
sprite
pyvmomi
intercept
fgets
boto
angle
indexoutofrangeexception
robotium-recorder
endpoints-proto-datastore
akka-stream
floyd-warshall
geckofx
heatmap
master-detail
jquery-chosen
android-ffmpeg
javapoet
crossfilter
google-optimize
apache-hive
scada
pi
maximo-anywhere
interstitial
falcor
pywinusb
invoke
android-datepicker
dependency-properties
oltp
google-url-shortener
sqlcommand
aide-ide
smf
spoon
eclipse-indigo
owner
graphic-effects
splash-screen
shapely
network-monitoring
euclidean-distance
sql-server-2008-express
cordova-chrome-app
like
mysql-num-rows
curator
desktop-shortcut
ember-qunit
tokumx
xcode-instruments
numpad
interlacing
texmacs
django-1.2
google-email-settings-api
nodejitsu
jquery-ui-selectable
dynamic-language-runtime
robohelp
emacs-dirtree
mercurial-subrepos
icefaces-1.8
c89
xemacs
32feet
hibernate-annotations
wind-river-workbench
webarchive
log5j
white-box-testing
abbreviation
testing-strategies
pvcs

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App