Run Time Error 1004

jyokom

Board Regular
Joined
May 24, 2004
Messages
148
The following code worked several times and is now giving a Runtime Error and tagging the dst.value = frm value portion
Code:
Sub UpdateWeekly()
Application.ScreenUpdating = False
Dim i, ofst As Integer
Dim frm, dst As Range
Set frm = Sheets("Weekly").Range("K5:BDI6")
Set dst = frm.Offset(2, 0)
frm.Replace "=", "#"

ofst = 8
For i = 1 To 2 'Sheets("Names").Range("A" & Rows.Count).End(xlUp).Row

dst.Value = frm.Value

dst.Replace "8", ofst + 6
dst.Replace "9", ofst + 7
dst.Replace "#", "="
ofst = ofst + 6
Set dst = dst.Offset(2, 0)
Next i
frm.Replace "#", "="
Application.ScreenUpdating = True
End Sub

Any ideas on why this is happening?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
iI'd start by checking if something has changed in the structure of the sheet - name of a tab maybe, if FRM value is on Weekly Tab in range K5:BD16 - check there is info there and it hasnt slipped off somewhere else, that there is still a weekly tab etc...
 
Upvote 0
Sounds like a possibly corrupted spreadsheet. In the past, I have copied the code into a text file, either exported or rebuilt any UserForms, and started a brand new workbook by creating a new module and pasting the text from the last worksheet into it.

EDIT: ^^ That is the 'bigger hammer', but you could try the same with just that function first.
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,521
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top