• 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.

Search results

  1. I

    How to resolve VBA error 2029 with #NAME?, while storing data in another workbook?

    I checked the NamedRange again, it is not a formula. I was preparing the file for demo purpose, and the code worked fine. There was no error saved as #NAME? I tried again with the problematic code in the original workbook. I performed the following: 1. Deleted and recreated the RangeName -...
  2. I

    How to construct a multiple search criteria?

    Hi Belleke, Thank you so much for the solution :awesome:. I could use this for one of my other reports, wonderful.:) With my post's requirement I am looking for filtering it in one VBA code. The input criteria for the report would be 3 parameters "Name", "Gender" and "Age". Based on these 3...
  3. I

    How to resolve VBA error 2029 with #NAME?, while storing data in another workbook?

    Thank you Chihiro. I will work and get the workbook for the demo purpose. Will post it Regards, Don
  4. I

    How to resolve VBA error 2029 with #NAME?, while storing data in another workbook?

    Thank you Chihiro for your reply. Due to confidentiality, I cannot upload the actual workbooks. Therefore, I listed the code snippet in my post. I am attaching a few snapshots of the sequence of the data entered and queried from the Table 1. Data Entered in Worksheet.JPG The cell format is...
  5. I

    How to construct a multiple search criteria?

    I just recorded the macro and have the below code: ActiveSheet.ListObjects("Tbl_Student").Range.AutoFilter Field:=1, Criteria1 _ :="=David" ActiveSheet.ListObjects("Tbl_Student").Range.AutoFilter Field:=2, Criteria1 _ :="=Male"...
  6. I

    How to construct a multiple search criteria?

    Hello Belleke, I forgot to upload the sample workbook. Please find attached the workbook for your reference. Many thanks & regards, Don
  7. I

    How to resolve VBA error 2029 with #NAME?, while storing data in another workbook?

    Hello There, I am using two excel files. File 1 for storing the data (as a Database) and File 2 for data entry. I am using the below code (in File 2) to update the corresponding table record in File 1. In File 2, values of the range fields are as below: EntWSDE_Header.[FStudentNumber] = 100...
  8. I

    How to change the format of a given range?

    Thank you Marc
  9. I

    How to change the format of a given range?

    Hello There, I have the below code which makes the colour of the cell to Automatic, only when the cell or range is selected Range("DNumberOK").Select With Selection.Font 'Make Font Green .ColorIndex = -16776961 .TintAndShade = 0 End...
  10. I

    How to construct a multiple search criteria?

    hahaha, good one. :p. My apologies These are just local variables for the excel table. There is an excel table whose name is "Tbl_Student" Sub FilterData Dim LOVMstTableColumn1, LOVMstTableColumn2, LOVMstTableColumn3 as String Dim LOVSearchValue1, LOVSearchValue2, LOVSearchValue3 as...
  11. I

    Save another workbook in the background

    Thank you Belleke :-)
  12. I

    Save another workbook in the background

    Hi Belleke, Thank you for your reply and the code. MstWB = Workbook 1 I am working on Workbook 2. The below Sub is in this workbook. When the below Sub gets fired it saves the MstWB. However, when doing so it displays the Workbook (i.e. MstWB), and then saves. I am looking for the...
  13. I

    Save another workbook in the background

    Hello There, I have 2 workbooks. I would like to have the following: Workbook 1 is the data stored Workbook 2 is where the User enters the data. This gets saved in Workbook 1. When the User clicks the button Save: 1. In the background, it should save the workbook 1, without any prompts or...
  14. I

    How to construct a multiple search criteria?

    Hello There, I have the below code used for only one column search criteria: LOVMstTableColumn1 = "Age" LOVSearchValue1 = "2" if LOVMstTableColumn1 <> "" Then .Range.AutoFilter Field:=.ListColumns(LOVMstTableColumn1).Index, Criteria1:="=*" & LOVSearchValue1 & "*" End if I would like...
  15. I

    Need help: Error passing listobject as parameter to a sub

    Hi Chihiro, Thank you for your reply. The actual workbooks are quite big. Therefore, posted only the code that was not working. Fortunately, when I extracted only that piece of code which was not working in the sample files, now it just works. Please find attached the sample workbooks for...
  16. I

    Need help: Error passing listobject as parameter to a sub

    Hi Chihiro, Thank you for the links. I checked but just cannot get it. Regards, Don
  17. I

    Need help: Error passing listobject as parameter to a sub

    Hi Chihiro, Thank you for your reply. The Public variables are declared at the beginning of the Module with Option Explicit. My CopyPaste mistake. Anything wrong you can detect in the code, as to why it is giving a ByRef argument type mismatch? Thanks & regards, Don
  18. I

    Need help: Error passing listobject as parameter to a sub

    Hello There, I have a Sub GetReferenceName which gets a value from the another excel table. This Sub uses parameters as List Object, Range and strings. The above Sub is called from event Worksheet_Change. I am getting an error on this event on calling this Sub Error Compile: ByRef argument...
  19. I

    Macro code to highlight cell -> How to convert into range & shorten the macro code?

    Hello There, I am using validations on certain pre-defined cell Ranges. If the User enters a wrong value then it should to the range --> Sub IncorrectField() If the User enters a correct value, then 1st it should check if it has the above highlight. If yes then apply Sub CorrectField() I...
  20. I

    Get values from a column & display it in a pre-defined range of columns

    Hi Marc, You are right. The ranges are fixed in Sheet2. Why loop through when it can be done straightforward. I will always keep this in mind :) Your solution works perfect and is faster :awesome: and I have already implemented the same. I was curious to learn more about arrays. Could you...
  21. I

    Get values from a column & display it in a pre-defined range of columns

    Hi Marc, Thank you for your reply. In the sample wotkbook, in Sheet1, the values are in column C5:C46. The code will work good. However, when the values can vary, can be less, at times will have more values How can the values in Sheet1 be listed in an array in a generic way and then use that...
  22. I

    Get values from a column & display it in a pre-defined range of columns

    Thank you Marc for the beginner code :). I have removed the merge cells Could you please be so kind to let me know how this can be done using Array or Collection. I tried doing it, but gave up, thats why this thread. Your sample code for this purpose will help me understand to apply the working...
  23. I

    Get values from a column & display it in a pre-defined range of columns

    Thanks Chihiro for the link. That is very useful Regards, Don
  24. I

    Get values from a column & display it in a pre-defined range of columns

    Hi Marc, Thank you for your reply. Just for my understanding why is it a bad idea to merge cells? I have a few workbooks where cells are merged. I can take necessary steps to keep it single cell instead. Attach a new workbook w/o cell merge for your reference. Regards, Don
  25. I

    Get values from a column & display it in a pre-defined range of columns

    Hello There, I have values in Sheet1 in a particular column. I would like to display it in Sheet2 in a fixed set of columns. I am aware this can be done using arrays/collections. I tried my best but couldn't get it done (wiped out everything). Could you please help me out how this can be done...
Back
Top