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