ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can I have 2 user forms that relate to the same worksheet (https://www.excelbanter.com/excel-programming/429908-can-i-have-2-user-forms-relate-same-worksheet.html)

ButterflyGirl

Can I have 2 user forms that relate to the same worksheet
 
Hi & thanks in advance,
I am trying to put 2 user forms that relate to the same worksheet, however
its not working...
I am getting an error message that says "Compile error: Invalid or
unqualified reference"
I am extremely new to programming so i would appreciate any help I can
get... I can email the "code" through if that helps.
--
Thanks,
Butterfly Girl

FSt1

Can I have 2 user forms that relate to the same worksheet
 
hi
why not just post your code here. everyone does it.

regards
FSt1

"ButterflyGirl" wrote:

Hi & thanks in advance,
I am trying to put 2 user forms that relate to the same worksheet, however
its not working...
I am getting an error message that says "Compile error: Invalid or
unqualified reference"
I am extremely new to programming so i would appreciate any help I can
get... I can email the "code" through if that helps.
--
Thanks,
Butterfly Girl


ButterflyGirl

Can I have 2 user forms that relate to the same worksheet
 
After 2 days of searching I actually found the answer myself!!! :-)
I left the _ (underscore) off the end of the 1st row & obviously this makes
a difference as to how the code is handled. Please explain why? But it is
now working perfectly.


lRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

--
Thanks,
Butterfly Girl


"FSt1" wrote:

hi
why not just post your code here. everyone does it.

regards
FSt1

"ButterflyGirl" wrote:

Hi & thanks in advance,
I am trying to put 2 user forms that relate to the same worksheet, however
its not working...
I am getting an error message that says "Compile error: Invalid or
unqualified reference"
I am extremely new to programming so i would appreciate any help I can
get... I can email the "code" through if that helps.
--
Thanks,
Butterfly Girl


Jacob Skaria

Can I have 2 user forms that relate to the same worksheet
 
It is actually a single line of code.

lRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row

_ is used as a line break; incase your code line is lenghty you can use a
space and underscore to break that to multiple lines.....

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


"ButterflyGirl" wrote:

After 2 days of searching I actually found the answer myself!!! :-)
I left the _ (underscore) off the end of the 1st row & obviously this makes
a difference as to how the code is handled. Please explain why? But it is
now working perfectly.


lRow = ws.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row

--
Thanks,
Butterfly Girl


"FSt1" wrote:

hi
why not just post your code here. everyone does it.

regards
FSt1

"ButterflyGirl" wrote:

Hi & thanks in advance,
I am trying to put 2 user forms that relate to the same worksheet, however
its not working...
I am getting an error message that says "Compile error: Invalid or
unqualified reference"
I am extremely new to programming so i would appreciate any help I can
get... I can email the "code" through if that helps.
--
Thanks,
Butterfly Girl



All times are GMT +1. The time now is 07:33 PM.

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