VBA help making a Database Viewer

khag

New Member
Joined
Jan 24, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello guys!

I need to make a database viewer on excel, a simple form to show some infos in one place.
i`m new with VBA, so i`m trying to do by myself, but every time i got stuck with the code.

here`s the thing, there`s more than 1 sheet and i need to work with it dynamically and with a image.

EXCEL_QXr1x2zECJ.png


The base layout

EXCEL_7qRjJoRjA3.png



Can someone help me with the code? Or at least show me the path to learn this, please!
Here`s a piece of code that i built, i don`t know if is really usable to do this.

VBA Code:
Private Sub UserForm_Initialize()

    Dim sh As Worksheet

    On Error Resume Next
    
    If cmbSheets.ListCount <> ThisWorkbook.Sheets.Count Then
    cmbSheets.Clear
    For Each sh In ThisWorkbook.Sheets
    If sh.Visible Then
    cmbSheets.AddItem xSheet.Name
    End If

    Next sh
    sh.Activate
    
    End If
End Sub

Thanks!!
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Hi, Please explain what you are trying to achieve.

What the combo box contains in user form?
If user select any value, what is the expected result?

On activating the user form, are you trying to show sheets name ?
 
Upvote 0
Hi, Please explain what you are trying to achieve.

What the combo box contains in user form?
If user select any value, what is the expected result?

On activating the user form, are you trying to show sheets name ?
Thank you so much for answering!

I want to select a sheet with the ComboBox and activate it

The listBox will show a column from this sheet, like "B:B". When I select a value from listbox, will show values in TextBoxes from a row of the selected column of the selected sheet on the ComboBox, .
Like, the listbox shows "B:B", if i select a especific row, like"B3" value on the listBox, the TextBoxes will show the subsequent especific value from the same row, like txtName = "C3", txtPrice = "D3", txtType = "E3".
The image will get a link from a local path in the same row too. (like imgProduct = "G3")
And the "TextBox Name (Vendor Sheet)" will get a value from the same selected row, like "C3" but from another sheet.

Sorry if I wasn't very clear
I just keep thinking it`s an easy task, but a really don`t have enough knowledge in VBA yet to do this
 
Upvote 0
Hi, Can you please share your sheet using GoogleDrive or any other drive .


Thanks,
Saurabh
 
Upvote 0
Hi,

Attached is the required sheet. Please use jpg format for images.

Download File

Thanks,
Saurabh
 
Upvote 0
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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