vlookup doesn't always work in this situation
by VGltIEw » Fri, 27 Feb 2004 04:11:12 GMT
I'm using Access vb to copy an Excel spreadsheet to a new filename, then fill in values from a recordset. The source .xls has formulas that use vlookup() and match() to find values in a third spreadsheet. (The values to be looked up and matched are blank until my code fills them in.)
When I open the newly created spreadsheet, I get the msg asking me if I want to refresh the lookups. If I say NO, then all my formulas containing lookup() and match() work as expected. If I say YES, then all of them return #NA. If I say NO then try to edit one of the formulas, that formula turns to text.
Any suggestions? Thanks.
Similar Threads:
1.precision as displayed doesn't always work
I need the number in the formula bar to show the same number as is displayed
in the spreadsheet. I used number formatting to set up my data to 2 decimal
places. Then I set precision as displayed. I even tried it by setting
precision as displayed first then used number formatting to 2 decimal places.
Either way, not all the numbers get set to 2 decimal places. Some do and
some don't. For example, I input a value of 0.26 and the formula bar shows
it as 0.259999999999 but my input value of 0.25 shows as 0.25 in the formula
bar.
2.worksheet change doesn't always work
I have noticed that the worksheet change doesn't always work,
expecially when I have been working on excel for a while and have
opened and closed a lot of workbooks,or if I have used VBA help alot...
if I reboot the computer and open a workbook that has a worksheet
change event it works fine, is there a way around this besides
rebooting the computer,
Here's the code I am using for one of the sheets: but I am sure it is
not the code because I have noticed this behaviour in othe workbooks...
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$5" Then
Range("G5").Select
ActiveCell.FormulaR1C1 = "=ROUNDUP(RC[-1]/8.0625,0)"
Range("C5").Select
Application.SendKeys "%{down}"
End If
If Target.Address = "$C$5" Then
Range("D5").Select
Application.SendKeys "%{down}"
End If
If Target.Address = "$D$5" Then
Range("B10").Select
Application.SendKeys "%{down}"
End If
If Union(Range("$b10:$b12"), Target).Address =
Range("$b10:$b12").Address Then
UserForm2.Show False
myRow = Target.Row
End If
End Sub
3.Using find- doesn't always seem to work
I have a number of sheets in an excel document. I'm
searching for a particular name that I know is in there. I
select all sheets (after right clicking on a sheet tab)
then press control f. It comes back with the response that
the word cannot be found.
Now most of the time it will find it but inexplicably
sometimes it won't. (correct spelling and punctuation is
being used)
4.ChDir doesn't always work
Is it in quotes
chdir "yours"
5."ComboBox1.ListIndex = 0" Doesn't seem to always work.
Hi,
I have "ComboBox1" on a UserForm. In the Sub Form Initialize procedure, I
have "ComboBox1.ListIndex = 0" hoping to set the ComboBox to Index 0 every
time the Form is loaded. The problem is that maybe 50% of the time it loads
up with the last selection instead. Am I doing something wrong?
Thank you for your help!
6. Why doesn't Selection.End(xlDown).Select always work?
7. status update during program run -- DoEvents doesn't always work
8. Linking with equals sign doesn't always work