View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
filo666 filo666 is offline
external usenet poster
 
Posts: 265
Default 2 questions, 1 easy about "" in VB, 1 very difficult

1.
I want to do the following:
sub fdljsdf()
bla bla bla

a = Target.Address
b = Right(Left(a, 2), 1)
u = Range(a).Row
If b = "I" Then
Range("J" & u).Formula = "=I" & u &
"/Vlookup(E6,[Registros.xls]Inventario!A:CA,[Registros.xls]Inventario!$C$3,0)"
End If
more bla bla bla
end sub

the question is:
If I want to change the formula so if there is no value in I & U output ""
the formula should look this way:

Range("J" & u).Formula = "=if(I" & u & "<"",I" & u &
"/Vlookup(E6,[Registros.xls]Inventario!A:CA,[Registros.xls]Inventario!$C$3,0),"")"

This difficult formula means, if for example, the user tryng to change cell
I6 then:
If cell I6<"" then cell I6/(a value in registros that should be founded)
else print "".

the problem is that VB misunderstanding the "" before the < and the ""
after the ,
how to explain VB that those "" are from the formula and aren't indicating
that they're text separators in the formula

please help me, this is driving me crazy.......


NOW THE OTHER ONE

2.
Hi, I'm tryng to accomplish something difficult to explain:
If you open a workbook (ex. hello.xls) and the you go to file--open another
file (ex. hello2.xls) then you have hello.xls and hello2.xls in the same
excel window, but if you open hello.xls ant then you go to the excels general
icon (the one that opens an excel window with a new woorkbook on it) ant
then you choose file--open hello2.xls then you have 2 excel windows, now my
problem: I have my firs book hello.xls with all the menu bars disabled but
the woorkbook hello2.xls needs all the menu bars enabled so if I open my
workbook as explained on the second way to open the file I can have my file
hello.xls without the menu bars and hello2.xls with all the menu bars
enabled; BUT I NEED TO OPEN EXCELS GENERAL ICON TO ACHIVE THIS, I mean, I
cant paste a shortcut in the desktop because when I open the second file, it
opens in the excels window of my first file.
It's very important that the user of my program could open the file from the
desktop, so there is a way to do what I want?????
If you want to see an example of what I mean firts open a excel file (any)
and then go to Iexplorer browser and choose the export data to excel
(pressindg the right button of your mouse and choosing the option mentioned),
as you can see not just a new workbook has been opened but a entire excel new
window (with his own workbook)
Hope this have sence, TIA

ALSO AS ENGLISH IS NOT MY FIRST LENGUAGE COULD YOU TELL ME HOW THE "" ARE
NAMED PLEASE
TIA