• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

retrieve data via VBA

Hi Deepak

fabulous work you have provided, thanks a lot for that.
sorry for another request as i'm not familiar with VBA coding
for Deduction sheet i need to show the columns but keep the hidden to be
and i added another sheet called "Admins" with "User, ID and Login" when this users login from the userform all spread sheets will be visible to edit the Source schedules,
 

Attachments

  • Points_Resized1.xlsm
    118.8 KB · Views: 7
Hi Deepak

fabulous work you have provided, thanks a lot for that.
sorry for another request as i'm not familiar with VBA coding
for Deduction sheet i need to show the columns but keep the hidden to be
and i added another sheet called "Admins" with "User, ID and Login" when this users login from the userform all spread sheets will be visible to edit the Source schedules,

This wb is not what i have uploaded. i will do the same & update you soon...
 
Hi,

Check username in both sheets as i have assigned col AG to user form while in your new sheet it has username like as col D. So, need to correct one of them.
 

Attachments

  • Points_Resized (2).xlsm
    153.5 KB · Views: 19
Hello Deepak,

so sorry for confusion, dear i didn't contain what you have been clarified, i ask how can the admins login to edit the all visible workbook.
the sheet schema isn't must, you can edit every thing as you like

thanks a lot,
 
Hello Deepak,

so sorry for confusion, dear i didn't contain what you have been clarified, i ask how can the admins login to edit the all visible workbook.
the sheet schema isn't must, you can edit every thing as you like

thanks a lot,

Have you checked what i have uploaded @ 28
 
Hi,

i'm already checked it more than one time, i can't login with the admin user that i added it in the attached sheet @26 with
User: Ahmed Abdelkader
ID: E50448
Login: 82301
to edit the others sheets or add other data
, and all sheet columns are visible, there are some hidden columns that i want to be hidden when i retrieve it

thanks a lot,
 
Hi,

@ #28 check to login with below credentials as i didn't made any changes on sheet data just added your admins sheet to the existing wb. so this is being occurred.

shehab.mohamed
w50566
82363

If still having issue then just start a conversations with me & i will do the needful on the spot.
 
@Deepak

sorry for back to the sheet again, after checked it more than one time, it's perfect.

i have another concern, due to the schedule source in "Deduction" sheet is connected in other sheet and want to review the schedule with all shown columns, so that i need if retrieve the data for some columns only without hiding the others from the source

the shown columns that i ask to retrieve are: ("A, F, J, W, Y, Z, AA, AB, AC, AD, AG, AH")

your great effort is highly appreciated

thanks a lot,
 
No need to say sorry as we are here to help.

As i got u only want to show data from below columns irrespective of visible/hidden columns..
A, F, J, W, Y, Z, AA, AB, AC, AD, AG, AH
 
yup i want the source schedule still with all columns shown, but when retrieve the data, retrieve only the mentioned columns

Thanks a lot
 
Check this!!!

Code:
Private Sub CommandButton1_Click()
Dim username As String, id As String, lid As String, mnth As String
Dim ws As Worksheet

Application.ScreenUpdating = False
With Me
username = .TextBox1.Value
id = .TextBox2.Value
lid = .TextBox3.Value
mnth = .ComboBox1.Value

If Not username <> "" Or _
    IsError(Application.Match(username, Range("Table_Source[Username]"), 0)) Then
        MsgBox "Pls input a valid username.", vbInformation
        .TextBox1.SetFocus
    GoTo e
End If

If Not id <> "" Or _
    IsError(Application.Match(id, Range("Table_Source[ID]"), 0)) Then
        MsgBox "Pls input a valid ID.", vbInformation
        .TextBox2.SetFocus
    GoTo e
End If

If Not lid <> "" Or _
    IsError(Application.Match(Val(lid), Range("Table_Source[Login]"), 0)) Then
        MsgBox "Pls input a valid LoginID.", vbInformation
        .TextBox3.SetFocus
    GoTo e
End If

If Not mnth <> "" Or _
    IsError(Application.Match(mnth, Range("Table_Source[Month]"), 0)) Then
        MsgBox "Pls use dropdown to select a month.", vbInformation
        .ComboBox1.SetFocus
    GoTo e
End If

End With

'using countif is more easy then match as there is no error trap to be used

With Sheet4
    .Visible = xlSheetVisible
    .Cells.Clear
End With

With Range("Table_Source")
    .AutoFilter 33, username
    .AutoFilter 6, id
    .AutoFilter 34, lid
    .AutoFilter 2, mnth
End With
'Range("Table_Source[#All]").SpecialCells(xlCellTypeVisible).Copy Sheet4.[a1]
Dim crng As Range
With Sheet2.ListObjects("Table_Source")
Set crng = Union(.ListColumns(1).Range, .ListColumns(6).Range, _
                .ListColumns(10).Range, .ListColumns(23).Range, _
                .ListColumns(25).Range, .ListColumns(26).Range, _
                .ListColumns(27).Range, .ListColumns(28).Range, _
                .ListColumns(29).Range, .ListColumns(30).Range, _
                .ListColumns(33).Range, .ListColumns(34).Range)
End With
crng.Copy Sheet4.[a1]
Range("Table_Source[#All]").AutoFilter
Set crng = Nothing
Unload Me
Sheet4.Activate

If (Application.CountIf(Range("Table3[Username]"), username) + _
    Application.CountIf(Range("Table3[ID]"), id) + _
    Application.CountIf(Range("Table3[Login]"), lid)) > 0 Then
    For Each ws In ThisWorkbook.Worksheets
        If ws.Name <> "Interface" Then ws.Visible = -1
    Next
End If

e:
Application.ScreenUpdating = True
End Sub
 
@ deepak

appreciate your support in handling an important request,
in the "deduction" sheet there is a column that called "TL" this column contain the leaders for the employee teams,
i need to create another user form contain 3 field
> 1st: for Leader user
> 2nd: for Password
> 3ed: select the month

the leader user we can match it from the "Deduction" sheet in column that called "TL"
them users and password filled in admin "sheet"

i need when use this userform and fill the leader inputs, retrieve the data table for his all team employee
 

Attachments

  • Deduction Points.xlsm
    178.6 KB · Views: 6
Two things need to clarify before going further.
  1. As i said earlier that the you should use username type of deepak.kumar instead of deepak kumar as same might create headache to users in login. So, if u are agree then do the necessary changes in both table of Admins sheet & upload it here.
  2. "retrieve the data table for his all team employee" : Show the entire columns data or need some specific as recent did #38.
 
Hi Deepak,

Ok there is no problem to apply these changes in users as you clarified the users has been modified, and what about of retrieving data it will be the same retrieved in post #38.

thanks a lot,
 

Attachments

  • Deduction Points.xlsm
    177.1 KB · Views: 3
Hi,
Pls find enclosed what u have asked for, i have also did the many changes in #38 code too.
Take time to validate & let me now if any issue occurred.
 

Attachments

  • Deduction Points_1.xlsm
    196.6 KB · Views: 11
@Deepak

Dear, if available i need another request may be complicated for me but according you are providing i think that it will like a piece of cake for you,

at agent userform at Rewarding button i need this data to be preview in a form not in an excel sheet

>> for every agent, there is, at last, rewarding point data for 2 -last- months: "its mean 2 row only".
want to create a button in this form to redeem the deduction points by this rewarding points.
>> but there is a rule: every 3 rewarding points remove 1 deduction point only.
>> the redemption will be by all rewarding existing points, the rest will be still
>> the redemption will be from any deduction points for the last "deduction" month
>> at deduction sheet, there is a column titled "Comment", when redeem any deduction points beside that cells in comment field need to put eg:"3 points redeemed" with red color
>> need confirmation msg with Yes/No option befor achieving the operation
>> when the employee hit redemption button to redeem his deduction points i need another action to notify me via mail by this operation
eg: if an employee will redeem 30 rewarding points, 10 deduction only will be removed, at deduction sheet beside any removed points cell, need a comment in "Comment" column and in the same operation an email will be sent -not displaied- to: Ahmed.mabdelkader@tedata.net CC: salesWFM@tedata.net
subject: rewarding redemption
body: kindly be noted that "username" has been redeem "30" rewarding points
at last need the workbook to be auto-saved after any operation
Gratefully,
 
Last edited:
Hi,

Two thing needs to say.
  • These days i am little more busy so can't afford time on the same, so sorry. You are requested to start a new post as someone will loop into the same to get it resolved.
  • After reading what have you posted is little confusing so same needs to make clear in new post or vice-versa.
 
Back
Top