View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Pierre[_18_] Pierre[_18_] is offline
external usenet poster
 
Posts: 19
Default advanced filter, goto next line(record)

Hi Steve,

As you can see, iám a novice in vba....

I now have all variables declared right !(no doubles but integers)
And your code works fine, just one problem;

I cannot fill a combobox with the value from a cell on the "datadga"sheet.

I have the following code;
If Not IsEmpty(filterrange.Offset(0, 3).Value) Then
cbo_mv = filterrange.Offset(0, 3).Value
End If
This gives an error message 380, somthing like cannot use the .value thing

any suggestions on this ?

By the way, i use the if then statement because the listitems of the
combobox do not nessesarily have to be the same as the cell on the datadga
sheet

Can you please help me once more ?
Thanks,
Pierre

"Incidental" schreef in bericht
...
Hi Pierre

I think the problem is coming from where you are declaring your
variables, I always explicitly declare my variables using Option
Explicit which I would recommend for all projects as this will allow
you use your variables in any sub in the module i.e. if you explicitly
declare "Dim FilterRange as Range" you will be able to use it in the
subs for the filter as well as the that of the next and previous
buttons. Also explicitly declaring your variables means that if you
have typed a variable wrong it will be made known to you when you run
the code, which can save hours of debugging time!!!

Just as a point I was wondering why you are using double for your
numerical variables as they will always be a whole number?? A double
is core commonly used for floating point (decimal) numbers, I would
use an integer for these myself.

Next is the "Call CellsToTextBoxes" line this refers to the sub called
CellsToTextBoxes which is being called, I would include this as it
means you will only have to write the code once to put the textbox
values into the cells and you can then call it from your next and prev
buttons which will reduce the size of the code and of course save you
having to type it.

I hope this helps you out but if you have any more questions just let
me know i will try to help.

Steve