Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. hannal

    get data from another worksheet - speed issue

    Hi! I have a suggestion that I think will speed up things a little. this is a method using arry calculations instead of excelfunctions like find, vlookup, match or similar. Copy this sub and run it as a macro on a sheet to see what happens. Hope it'll be useful, maybe you already now this...
  2. hannal

    Syntax for relative R1C1 with variables?

    For your information: I found the error. There must be a space between the & and the variable e.g. "& myField &" is OK "&myField&" is WRONG Amazing I didn't realize before... Rgds HL
  3. hannal

    Syntax for relative R1C1 with variables?

    Hi! Neither do I now.... I spent 5 hours trying to get the syntax to work and all the time I either got the error message: 'Run-time error 1004, Application-defined or Object-defined error' when I was running my macro, or my code didn't even get get trough the debugger. Since I'm new at...
  4. hannal

    Syntax for relative R1C1 with variables?

    In a Sub I have this code: Application.Goto Reference:="myField" Selection.FormulaR1C1 = "=RC[-3]+RC[-1]" Note that myField is a column (in a database area, myField is the field name of the column) so the formula is calulated on all cells in the column, and for each cell...
  5. hannal

    How to define a new database area using varible row/column nr

    SkipVought: Hi! Thanks, I wanted to use the cells method but couldn't work out the syntax. Unfortunately I have emtpy rows inside this dataarea, so I'll have to settle with the first tip although the second one would have been great to use! /HL
  6. hannal

    How to define a new database area using varible row/column nr

    Thanks! Works perfect. I'm new at VBA and being able to use variables in references opens up a lot of possibilities. None of the books that I use mention this syntax. A star from me! /HL
  7. hannal

    How to define a new database area using varible row/column nr

    Hi! I’m trying to do a macro that define a new database area from cell A1 to the cell at the r:th row and c:th column. How can I use a reference that takes variables as argument? Like for example, Cells(r, c)? I can select the new area with this code. range(Cells(10, 1), Cells(r, c)).Select...
  8. hannal

    How to get rows/cols from Excel-sheet into a VBA-Array without loops?

    Thank you so much, both of you! It worked beautifully when I wrote my function like this: Function myFun(area1 As Range) Dim area2 As Variant ‘…mycode… area2 = area1.Value2 mySub area2 ‘…mycode… End Function With: Sub mySub(area3 As Variant) Dim i, j, k, l As Integer...
  9. hannal

    How to get rows/cols from Excel-sheet into a VBA-Array without loops?

    Hi! My main problem is how to convert a Range object into an Array without using any loops? This is the background: I need to write a user-defined function in VBA for Excel that takes a Range (2 cols and many rows) in an Excel-sheet as an argument and rearrange the rows so that the values in...

Part and Inventory Search

Back
Top