Having difficulty with scroll bar in VB

  • Thread starter Thread starter Pam
  • Start date Start date
P

Pam

I have tried everything to get my scroll bars to work in my form. Even to the
point of trying to shrink my information down in my form so I wouldn't have
to use them.
I am new to VB, but I have done some programing, just not an extensive form.
I have a form that started out in VB for applications, so that it could dump
into an excel worksheet when it was filled out.
I have tried the instructions at
http://articles.techrepublic.com.com/5100-6228_11-5355438.html in the VB for
Apps as well as in VB 2008 Express that I downloaded. I get the form, the
code will not work, I don't know if I have to declare something, or even how
to declare something.
I have also tried putting the form with a picture box and putting the scroll
on the picture box. The scroll bar moves, but the picture box does not.
I have worked on this for 12 hours, and I know it has to be something really
simple, but it's killing me.
I'm also not sure if this is the right place to post this, but was told in a
developer forum that this forum might be able to help me with the vba, but
maybe not the 2008 Express.
Any help would be appreciated.
Thank you.
 
Insert a new form, put some controls on it.
In the Properties window in the VBE...
Set ScrollBars to "3 - fmScrollBarsBoth"
Set ScrollHeight to approximately twice the form height.
Set ScrollWidth to approximately twice the form width.
Show the form and try it.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)




"Pam"
wrote in message
I have tried everything to get my scroll bars to work in my form. Even to the
point of trying to shrink my information down in my form so I wouldn't have
to use them.
I am new to VB, but I have done some programing, just not an extensive form.
I have a form that started out in VB for applications, so that it could dump
into an excel worksheet when it was filled out.
I have tried the instructions at
http://articles.techrepublic.com.com/5100-6228_11-5355438.html in the VB for
Apps as well as in VB 2008 Express that I downloaded. I get the form, the
code will not work, I don't know if I have to declare something, or even how
to declare something.
I have also tried putting the form with a picture box and putting the scroll
on the picture box. The scroll bar moves, but the picture box does not.
I have worked on this for 12 hours, and I know it has to be something really
simple, but it's killing me.
I'm also not sure if this is the right place to post this, but was told in a
developer forum that this forum might be able to help me with the vba, but
maybe not the 2008 Express.
Any help would be appreciated.
Thank you.
 
Jim,
I did the new form, put some boxes on it, put scroll bars on it, set the
h=400 and w=400, set the properties for the scroll bars that I ADDED to
h=800, w=800, BUT is there some way to set the property for the visible
scroll bars?
Needless to say, the way I did it didn't work. At this point, I'm splitting
the form into two parts, and calling one from the other, I guess I can't wrap
my brain around this logic.
Thank you
Pam
 
Pam,

How about one of the microsoft.public.vstudio newsgroups? There's likely to
be quick assistance there with your problem. This one's quite specific to
Excel VBA.

Damien
 
In your original message you said: "I have a form that started out in VB for applications".
So my instructions applied to opening Excel, opening the Visual Basic Editor (Alt + F11),
opening the Properties window (F4) and proceeding.
Is that what you did?
The scroll bars are a property of the UserForm, they are not "added" - they are "displayed"
when the ScrollBars property (in the Properties window) is set to 3.
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Pam"
wrote in message
Jim,
I did the new form, put some boxes on it, put scroll bars on it, set the
h=400 and w=400, set the properties for the scroll bars that I ADDED to
h=800, w=800, BUT is there some way to set the property for the visible
scroll bars?
Needless to say, the way I did it didn't work. At this point, I'm splitting
the form into two parts, and calling one from the other, I guess I can't wrap
my brain around this logic.
Thank you
Pam
 
Thank you Jim, Yes, I did just that, but it didn't work, so I added the
scroll bars hoping that would work. I'm in Excel 2007. But, the good news is
that I got the form separated in two sheets, and have gotten it to open the
other form with no problem, and have it writing back to the the spreadsheet.
Thank you for your help, I'll give up on the scroll bar for now.
Pam
 
Thank you Damien, I will try that!
Pam

Damien McBain said:
Pam,

How about one of the microsoft.public.vstudio newsgroups? There's likely to
be quick assistance there with your problem. This one's quite specific to
Excel VBA.

Damien
 
Back
Top