Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-27-2022, 12:53 PM
petedacook petedacook is offline VBA error 1004 Application-defined or object-defined error Windows 11 VBA error 1004 Application-defined or object-defined error Office 2021
Novice
VBA error 1004 Application-defined or object-defined error
 
Join Date: Oct 2022
Posts: 2
petedacook is on a distinguished road
Default VBA error 1004 Application-defined or object-defined error

Not sure what I'm doing wrong here. I get object defined error on the line "icell.Offset(0, 5).Value = fullpath & colRef & lookrow"
I can print the concatenate results and look at it in a msgbox, but it will not let me inset the value in the "iCell offset."



This is the secton from a larger section of code that is giving me the problem:


Sub test()
Dim icell As Range
Dim fullpath, colRef, lookrow As String
Dim lrow As Long

lrow = Cells(Rows.Count, 2).End(xlUp).Row

For Each icell In Range(Cells(4, 3), Cells(lrow, 3))
lookUp = icell & icell.Offset(0, 2) & icell.Offset(0, 3)
If IsError(Application.WorksheetFunction.VLookup(look Up, refTable, 5, 0)) Then
Else
lookrow = Application.WorksheetFunction.VLookup(lookUp, refTable, 5, 0)
Budg_Add = fullpath & colRef & lookrow
MsgBox Budg_Add
icell.Offset(0, 5).Value = fullpath & colRef & lookrow
End If
Next icell


End Sub


For what it's worth, the end result is a link to a cell in another file.
Reply With Quote
  #2  
Old 10-27-2022, 01:22 PM
petedacook petedacook is offline VBA error 1004 Application-defined or object-defined error Windows 11 VBA error 1004 Application-defined or object-defined error Office 2021
Novice
VBA error 1004 Application-defined or object-defined error
 
Join Date: Oct 2022
Posts: 2
petedacook is on a distinguished road
Default

I figured it out. The name to the other file was missing the closing bracket "]". DUH!
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA error 1004 Application-defined or object-defined error FileSystemObject Compile Error: User-Defined Type Not Defined gsrikanth Excel Programming 2 03-28-2022 06:32 AM
VBA error 1004 Application-defined or object-defined error Application Defined or Object defined error bennyamy Excel Programming 4 03-23-2017 11:42 AM
VBA error 1004 Application-defined or object-defined error Range.Information(wdStartOfRangeRowNumber): Application-defined or Object-defined err tinfanide Excel Programming 2 06-09-2012 10:19 AM
VBA error 1004 Application-defined or object-defined error Application-defined or Object-defined error Manit Excel Programming 4 12-08-2011 07:35 PM
TOC printing Error Bookmark not Defined techexpressinc Word 0 12-14-2008 05:24 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:23 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft