A1 Notation error

davide128

Board Regular
Joined
May 12, 2010
Messages
58
why do I get the error Application-defined or Object Defined error below

Code:
ActiveSheet.Cells("H" & LTrim(Str(ActiveSheet.ListObjects("tblConfigData").ListRows.Count + 1))).Value = strPaneOptions
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Can't see it offhand, but that can just be written as:
Code:
ActiveSheet.Cells("H" & ActiveSheet.ListObjects("tblConfigData").ListRows.Count + 1).Value = strPaneOptions
 
Upvote 0
Sorry - must pay more attention!
Code:
ActiveSheet.Range("H" & ActiveSheet.ListObjects("tblConfigData").ListRows.Count + 1).Value = strPaneOptions
 
Upvote 0
cool..that worked..one problem..when I define my table can I tell it to treat entries as test..in my above example strPaneOption contain 5/6 and when I set the value Excel changes it to 6-May..converts it to a date which I don't want
 
Upvote 0
Format the column as Text, or prefix the stored value with an apostophe.
 
Upvote 0
Code:
ActiveSheet.ListObjects("tblConfigData").Range.Numberformat = "@"
should do it.
 
Upvote 0

Forum statistics

Threads
1,224,543
Messages
6,179,429
Members
452,914
Latest member
echoix

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