Try this code : Unhide the sheet, activate it, Run your query and hide again. If it is still a problem, then you will have to check your querytable.
With ActiveWorkbook.Worksheets("SearchData12")
.Visible = True
.Activate
.Range("C11").QueryTable.Refresh BackgroundQuery:=False
.Visible =...
HI EXCELlents,
Thank you for your valuable views.
So, It doesn't matter what we choose but should do the task faster than any other alternate ways.
@Jeffreyweir : Exciting to watch VBA vs native formulas. Looking forward for it.
Hi Excel Gurus,
Though I was a member with chandoo from quite a time but was not active. Chandoo is keeping me very busy from last week and made to realize the fun I missed out.
To jump into the topic, what should one consider while writing a lengthy function?
A) less character length...
Hi KJT,
Its the same name as the function. If you have this function in workbook module, then on any cell of your workbook enter
=mylookup(value to check, range to check)
eg.. =mylookup("1254367890", "a1:a400")
Hi KJT,
Give a try with the below UDF. Copy it to the workbook module and use the formula on the worksheet. Its not a refined version, but can make it better if this works for you.
Public Function MYLookup(lookup_value As String, table_array As Range) As String
Dim c As Range
Dim x As Integer...
Not sure, if this affects any other part of your code but give a try. Check the number of attachments (.Item.Attachments.Count) before the loop and run it only if the attachment count is greater than 0.
If .Item.Attachments.Count >0 then
For x = 1 To .Item.Attachments.Count...
Put a breakpoint and check the (.Item.Attachments.Count) value before the next statement gets executed. I guess, it is setting up this value to 0 in some form which is breaking this. Also set (X=0) before the for loop and try.
Use this VBA code on your Sheet object events. When you manually change any data (F2) on any cell, the cell forecolor turns blue. I hope this is what you are trying to achieve here.
Private Sub Worksheet_Change(ByVal Target As Range)
Target.Font.Color = ColorConstants.vbBlue
End Sub
Check if your previous email has got any attachments. If there are no attachments then the (.Item.Attachments.Count) will be 0 and your loop will fail if there are no attachments to delete.
For x = 1 To .Item.Attachments.Count
.Item.Attachments(x).Delete
Next x
Write your code under Worksheet_SelectionChange event (on Worksheet object). Be aware that this event triggers with every other selection you make on worksheet. If you want to do it only for a certain range, you can validate the address of the selection.
Private Sub...
Finally, Google GOD has answered my prayer. I am able to make it work after following the link below.
http://www.access-programmers.co.uk/forums/showthread.php?t=204203
Hi Friends,
I have an excel addin which creates custom toolbar/menu in Excel 2003 on load. The toolbar has 6 buttons in total, but hides/disables two or three buttons based on the user logged in. I validate the user logged in through company webservice and identify the user role. Based on the...