need some features in an excel form and some unexpected error to resolve

AparnaWangu

New Member
Joined
Aug 22, 2016
Messages
11
Hi Team,

I have created an onboarding form for employees and there is a worksheet where the data is getting stored.

The problem is now there is a runtime error coming in a listbox click function where all the records are displayed from the datasheet so in case of any modification user dont have to go to datasheet again and again.

I am attaching the file for reference with some dummy data.Please check that why that error comes.

Secondly I want the the headers to be displyed for all the columns in the list box which is not happening currently.

I am new to VBA so please please please help me.

Private Sub LB_00_Click()
For i = 0 To 4
Me("T_0" & i) = LB_00.Column(i) The error comes as runtime error and could not find the specified object
Next



Regards,
APS
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi AlphaFrog,

Can u also help me with the second quey. I want to have headers for the columns in a list box . How can I have it?
 
Upvote 0
Code:
[color=darkblue]With[/color] LB_00
    .ColumnHeads = [color=darkblue]True[/color]
    .ColumnCount = 14
    .ColumnWidths = "40;150;150;90;70;150;30;30;30;30;30;30;30;30"
    .RowSource = "Data!" & Sheets("Data").Range("A1").CurrentRegion.Address
[color=darkblue]End[/color] [color=darkblue]With[/color]
 
Upvote 0
Code:
[COLOR=darkblue]With[/COLOR] LB_00
    .ColumnHeads = [COLOR=darkblue]True[/COLOR]
    .ColumnCount = 14
    .ColumnWidths = "40;150;150;90;70;150;30;30;30;30;30;30;30;30"
    .RowSource = "Data!" & Sheets("Data").Range("A1").CurrentRegion.Address
[COLOR=darkblue]End[/COLOR] [COLOR=darkblue]With[/COLOR]

Thankyou so much Alphafrog. Your code works only there is a small error coming up
like it is showing Column A Cplumn B and so on in header and below it it is showing the column headers. So how to remove the Col A, ColB, Col C etc

Regards,
 
Upvote 0
Code:
.RowSource = "Data!" & Sheets("Data").ListObjects(1).DataBodyRange.Address

Thanks a ton Dear AlphaFrog. You are genius.Its works!

Only one small help. While entering data in the Hire date column it is displayed in dd-mm-yyyy format but when I select a entry from the listbox it is displayed in number format. Can u help me out.

Regards,
 
Last edited:
Upvote 0
Also there is an error coming in the form on selecting a record from listbox and when I click the update button this error is coming Runtime error 70 permission denied.
LB_00.List = [data_tbl].Value This is the line where error is coming.


​Regards,
 
Upvote 0

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,624
Latest member
gregg777

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