ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Object required Run-time error '424' (https://www.excelbanter.com/excel-programming/432839-object-required-run-time-error-424-a.html)

Ayo

Object required Run-time error '424'
 
I am getting the above error on the line of code:
Application.ActiveCell.Offset(0, cCol).Text = ctl.Text

and I am not sure what I am doing wrong. Any ideas?


Gary''s Student

Object required Run-time error '424'
 
Text is read-only. How about:

Sub qwerty()
Dim stl As Range, cCol As Integer
Set ctl = Range("A1")
cCol = 0
Application.ActiveCell.Offset(0, cCol).Value = ctl.Text
End Sub

--
Gary''s Student - gsnu200901


"Ayo" wrote:

I am getting the above error on the line of code:
Application.ActiveCell.Offset(0, cCol).Text = ctl.Text

and I am not sure what I am doing wrong. Any ideas?


Phil Hibbs

Object required Run-time error '424'
 
Ayo wrote:
I am getting the above error on the line of code:
* * * * *Application.ActiveCell.Offset(0, cCol).Text = ctl.Text

and I am not sure what I am doing wrong. Any ideas?


What's the value of cCol? One of the functions is returning a null
object. Try breaking it up and see which one fails:

Dim Thing As Object
Set Thing = Application
Set Thing = Application.ActiveCell
Set Thing = Application.ActiveCell.Offset(0, cCol)
Set Thing = Application.ActiveCell.Offset(0, cCol).Text
Set Thing = ctl.Text

Phil Hibbs.

Jacob Skaria

Object required Run-time error '424'
 
Try
Application.ActiveCell.Offset(0, cCol) = ctl.Text

If this post helps click Yes
---------------
Jacob Skaria


"Ayo" wrote:

I am getting the above error on the line of code:
Application.ActiveCell.Offset(0, cCol).Text = ctl.Text

and I am not sure what I am doing wrong. Any ideas?


Ayo

Object required Run-time error '424'
 
Thanks.

"Gary''s Student" wrote:

Text is read-only. How about:

Sub qwerty()
Dim stl As Range, cCol As Integer
Set ctl = Range("A1")
cCol = 0
Application.ActiveCell.Offset(0, cCol).Value = ctl.Text
End Sub

--
Gary''s Student - gsnu200901


"Ayo" wrote:

I am getting the above error on the line of code:
Application.ActiveCell.Offset(0, cCol).Text = ctl.Text

and I am not sure what I am doing wrong. Any ideas?



All times are GMT +1. The time now is 11:14 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com