|
-
Aug 8th, 2007, 03:14 AM
#3
Re: VB6 - Merge Cells in spreadsheet
i have done some testing on a sheet, i used the code below to put a long string into a single cell, the entire string was visible across all the empty cells in the row. if the are any characters (even a space) in any cell in that row then the text will not show past that cell, so you need to check if any cells are not empty, even though you can see nothing, in any instance the #value did not show, just part of the text string, upto the first used cell
i thought there might be a limitation as to how many characters can go in a cell, but it would appear not or it is a very large number
code used Sheets("Sheet1").Cells(14, 1) = String(60000, "w")
at 70000 i get out of memory error
Cell Error Values
You can insert a cell error value into a cell or test the value of a cell for an error value by using the CVErr function. The cell error values can be one of the following XlCVError constants.
Constant Error number Cell error value
xlErrDiv0 2007 #DIV/0!
xlErrNA 2042 #N/A
xlErrName 2029 #NAME?
xlErrNull 2000 #NULL!
xlErrNum 2036 #NUM!
xlErrRef 2023 #REF!
xlErrValue 2015 #VALUE!
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|