Home |
Search |
Today's Posts |
#11
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Can't say for sure without looking at your file. If there's any reason vData is not a 2D array then that line will definitely throw an error. Try this on any sheet... Sub test() Dim v v = Range("A1:D2") Debug.Print "rows:=" & UBound(v) Debug.Print "cols:=" & UBound(v, 2) End Sub ..and it should return... rows:=2 cols:=4 Garry It returned 2 & 4 for every sheet, Summary & A to G, and the same for a new workbook made with same names and the data copied to each sheet. I did notice while the .cells... line was yellow highlighted that the .End(xlDown) was showing -4162 when mouse over it. vData = wks.Range("A2", wks.Range("D2").End(xlDown)) 'Assign the array to the next row position .Cells(lNextRow, 1).Resize(UBound(vData), UBound(vData), 2) = vData Then another time it showed a date. Column D header is "Datum" and custom formatted to dd-mm-yyy. I have no idea why it showed -4162 that one time. Howard |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Update Cell in WKBook 1 From WkBook 2 | Excel Discussion (Misc queries) | |||
VBA Open Wkbook Disabling Macros | Excel Programming | |||
How to link to a single wksheet in a wkbook that has comments | Excel Discussion (Misc queries) | |||
[hlp]: How to copy a sheet to new wkbook and close the var at the end | Excel Programming | |||
Can changes to a worksheet be applied to all wksheets in wkbook? | Excel Worksheet Functions |