ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VB beginner (https://www.excelbanter.com/excel-programming/371873-vbulletin-beginner.html)

Matthew Balch

VB beginner
 
My name is Matthew Balch.

I have extensive use of data and excel. Due to the nature of work I am
currently undertaking I need to learn VB.

I am at struggling with the help files and examples. I think I find the
answer, try it, only for an error to appear.



I have two very basic queries which I cant seem to solve using the help
files:-



1) Create a new command button on auto_open?



2) Display a form



Obviously the basics!

Could someone possibly help? And or, point me in the right direction to
lookup this information and a guide for absolute beginners like me!



Cheers

Matt


Matthew Balch[_2_]

VB beginner
 
Microsoft 2003, VB 6.3

"Matthew Balch" wrote:

My name is Matthew Balch.

I have extensive use of data and excel. Due to the nature of work I am
currently undertaking I need to learn VB.

I am at struggling with the help files and examples. I think I find the
answer, try it, only for an error to appear.



I have two very basic queries which I cant seem to solve using the help
files:-



1) Create a new command button on auto_open?



2) Display a form



Obviously the basics!

Could someone possibly help? And or, point me in the right direction to
lookup this information and a guide for absolute beginners like me!



Cheers

Matt


Bob Phillips

VB beginner
 



"Matthew Balch" <Matthew wrote in message
...
My name is Matthew Balch.

I have extensive use of data and excel. Due to the nature of work I am
currently undertaking I need to learn VB.

I am at struggling with the help files and examples. I think I find the
answer, try it, only for an error to appear.



I have two very basic queries which I cant seem to solve using the help
files:-



1) Create a new command button on auto_open?



Why would you create it on open. That would mean you create a new one every
open.

2) Display a form


Userform1.Show



Matthew Balch[_2_]

VB beginner
 
Thanks for the reply Bob,

On both of the queries I can get the vb to work on new spreadsheets. But
when I copy it across to the spreadsheet I want them in the vb coding is no
longer recognising the variants.

do you know what has happened?

1)
On workbook_open I would like a menu created with just a couple of buttons
to which I can assign macros:-

This is what Ive got on a separate workbook (copied from somewhere) which
works fine (although not linked to any macros as Ive not worked out how to do
that yet!)

Public Sub CreateCommandBarWithControls()

' Purpose: Creates a sample command bar with a number
' of controls.

Dim objCommandBar As Office.CommandBar
Dim objCommandBarControl As Office.CommandBarControl
Dim objCommandBarButton As Office.CommandBarButton
Dim objCommandBarComboBox As Office.CommandBarComboBox
Dim objCommandBarPopup As Office.CommandBarPopup

For Each objCommandBar In Application.CommandBars

If objCommandBar.Name = "Top Bud" Then

objCommandBar.Delete

End If

Next objCommandBar

Set objCommandBar = Application.CommandBars.Add _
("Top Bud")

With objCommandBar.Controls


Set objCommandBarComboBox = .Add(msoControlDropdown)

With objCommandBarComboBox

.AddItem "Index"
.AddItem "Check Sheet"
.AddItem "Summary"
.Style = msoComboLabel
.Caption = "Sheet Selection"

End With

Set objCommandBarButton = .Add(msoControlButton)

With objCommandBarButton

.Caption = "Refresh Data"
.Style = msoButtonIconAndCaption
.TooltipText = _
"Press to restablish links and refresh data."

End With

Set objCommandBarButton = .Add(msoControlButton)

With objCommandBarButton

.Caption = "Generate Trading Accounts"
.Style = msoButtonIconAndCaption

End With


End With

objCommandBar.Visible = True

End Sub

re 2)
I dont understand at all.

Very simple I know but it doesn't seem to work!





"Bob Phillips" wrote:




"Matthew Balch" <Matthew wrote in message
...
My name is Matthew Balch.

I have extensive use of data and excel. Due to the nature of work I am
currently undertaking I need to learn VB.

I am at struggling with the help files and examples. I think I find the
answer, try it, only for an error to appear.



I have two very basic queries which I cant seem to solve using the help
files:-



1) Create a new command button on auto_open?



Why would you create it on open. That would mean you create a new one every
open.

2) Display a form


Userform1.Show




Matthew Balch[_2_]

VB beginner
 
Further more my project (small one?!) is to create a budgeting spreadsheet.
This entails creating something in excel which replicates the way a database
interfaces.
Obviously I am starting at the very beginning and looks like a very ominious
task given my ability (lack of) to find the answers.

Overall I am preparing a budget for journals that has lots of different
variables and users.

I would like a data input intereface separated by user (which select from a
drop down menu). ie an Editor. This then selects all the relevant titles, and
variables that go with that, each title will have 30 + different price
variables. These price variables are made up of four fields. Then I want the
user to be able to enter budgetd Nos (target sales) and the price being
looked up from a seperate database list - a list included within the same
workbook. I would like the user to able amend what has been input etc.

Also would like fast searches using a title search etc.

From the numbers and prices in the data sheet I then need to populate values.
I have different regions and different exchange rates.

......lots more to it but thats just a basic overview.




All times are GMT +1. The time now is 08:12 PM.

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