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

Excel Formula to copy cell value to a column based on condition
Excel Webservice Function Yahoo Finance
Using a dynamic cell value in excel VBA
Excel VBA gives type mismatch on dividing decimal numbers after split
Get data from a website table to the excel sheet
VBA Set Dropdown value
VBA Access to Excel export, Error 1004 and 70 when re-running the script
Excel 2010 if condition occurs in column
Do Until loop gives Unknown Runtime Error in VBScript
Count distinct words in the row and paste the count in sheet 2
Adjusting the formula in formulaarray
Convert a URL formatted content to plain text in microsoft EXCEL
Using arrays inside functions in VBA
using two recordset vba excel
many multiple conditional checks in single excel function
Run VBA macro whenever any workbook is opened

Categories

HOME
cron
reverse-geocoding
asynchronous
scenekit
linux-device-driver
unity5
android-gradle
quandl
http-headers
osticket
uinavigationcontroller
google-cardboard
fluent-assertions
crystal-reports-xi
interaction
dynamics-ax-2012
watchkit
netbeans-7.3
code-injection
cider
xmlstarlet
webcam
footable
nexmo
bluehost
yamldotnet
free-jqgrid
legacy
dexguard
scada
android-runonuithread
dreamhost
instrumentation
google-truth
data-processing
reduce
cakephp-2.x
preferencefragment
silent-installer
wso2-appm
nuodb
playstation
r.js
synopsys-vcs
leap-motion
nsoutlineview
local-variables
ucp
servant
cts
pragma
r1soft
pdf-extraction
datamapper
johnny-five
8085
delphi-5
moovweb
proto
order-of-operations
c1flexgrid
wunderlist
t4-toolbox
hashbytes
google-text-to-speech
irssi
arbitrary-precision
typescript1.4
tbb
ntl
usermode
gideros
imagecreatefrompng
opengl-es-1.1
mercurial-subrepos
struts-config
iphone-sdk-3.0
single-user
windows-explorer
wss-3.0
orbited
codehighlighter

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