![]() |
Code character limit with Resize or Transpose or cell?
This line works well in a macro dealing with a large amount of data to be transposed into a single cell.
So if it throws an error, then is it safe to assume the receiving cell character limit is exceeded or is it within the code as I have posted here. ..Cells(k, 1).Resize(rowsize:=UBound(arrOut) + 1) = _ WorksheetFunction.Transpose(arrOut) In either case is there a work-around? Thanks, Howard |
Code character limit with Resize or Transpose or cell?
Assuming this line has an object ref to a wks or rng...
.Cells(k, 1).Resize(UBound(arrOut) + 1, 1) = _ Application.Transpose(arrOut) ...you're 'good-to-go'! -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
Code character limit with Resize or Transpose or cell?
On Thursday, May 1, 2014 6:30:59 PM UTC-7, GS wrote:
Assuming this line has an object ref to a wks or rng... .Cells(k, 1).Resize(UBound(arrOut) + 1, 1) = _ Application.Transpose(arrOut) ..you're 'good-to-go'! -- Garry Ok, I'll give that a go. Thanks Garry. Howard |
Code character limit with Resize or Transpose or cell?
On Thursday, May 1, 2014 6:30:59 PM UTC-7, GS wrote:
Assuming this line has an object ref to a wks or rng... .Cells(k, 1).Resize(UBound(arrOut) + 1, 1) = _ Application.Transpose(arrOut) ..you're 'good-to-go'! -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion Yes, it is in a With Sheets("A Name of sheet") and also in a For i = LBound(myArr) To UBound(myArr) Howard |
Code character limit with Resize or Transpose or cell?
On Thursday, May 1, 2014 6:30:59 PM UTC-7, GS wrote:
Assuming this line has an object ref to a wks or rng... .Cells(k, 1).Resize(UBound(arrOut) + 1, 1) = _ Application.Transpose(arrOut) ..you're 'good-to-go'! -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion Yes, it is in a With Sheets("A Name of sheet") and also in a For i = LBound(myArr) To UBound(myArr) Howard But your counter in the line of code is 'k' NOT 'i'!!! -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
Code character limit with Resize or Transpose or cell?
On Thursday, May 1, 2014 6:57:11 PM UTC-7, GS wrote:
On Thursday, May 1, 2014 6:30:59 PM UTC-7, GS wrote: Assuming this line has an object ref to a wks or rng... .Cells(k, 1).Resize(UBound(arrOut) + 1, 1) = _ Application.Transpose(arrOut) ..you're 'good-to-go'! -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion Yes, it is in a With Sheets("A Name of sheet") and also in a For i = LBound(myArr) To UBound(myArr) Howard But your counter in the line of code is 'k' NOT 'i'!!! -- Garry Does this make more sense? I know the entire macro is legit because it is from Claus. Myself and another amateur broadened the data the code was working on and then error. I ran you suggestion on a lesser amount of data and no problem, I don't have the greater data example amount to test with at present. Hoping it will work. ' Original '.Cells(k, 1).Resize(rowsize:=UBound(arrOut) + 1) = _ WorksheetFunction.Transpose(arrOut) .Cells(k, 1).Resize(UBound(arrOut) + 1, 1) = _ Application.Transpose(arrOut) k = k + UBound(arrOut) + 1 ' from Garry ' .Cells(k, 1).Resize(UBound(arrOut) + 1, 1) = _ ' Application.Transpose(arrOut) Howard |
Code character limit with Resize or Transpose or cell?
Does this make more sense? I know the entire macro is legit because
it is from Claus. Myself and another amateur broadened the data the code was working on and then error. I ran you suggestion on a lesser amount of data and no problem, I don't have the greater data example amount to test with at present. Hoping it will work. ' Original '.Cells(k, 1).Resize(rowsize:=UBound(arrOut) + 1) = _ WorksheetFunction.Transpose(arrOut) .Cells(k, 1).Resize(UBound(arrOut) + 1, 1) = _ Application.Transpose(arrOut) k = k + UBound(arrOut) + 1 It looks okay to me! It appears you are transfering data from one sheet to another, starting 1 row below existing data. Note my use of 'Application.Transpose' in place of 'WorksheetFunction.Transpose' is purely for the purpose of making my code VB^ friendly. It allows me to use Find/Replace for substituting my object var "appXL" for the ref to "Application". I'm in the process, though, of just using "appXL" everywhere I ref "Application" in code and so you may see that in future postings of code snippets I copy/paste from working projects. -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
Code character limit with Resize or Transpose or cell?
It looks okay to me! It appears you are transfering data from one sheet to another, starting 1 row below existing data. Note my use of 'Application.Transpose' in place of 'WorksheetFunction.Transpose' is purely for the purpose of making my code VB^ friendly. It allows me to use Find/Replace for substituting my object var "appXL" for the ref to "Application". I'm in the process, though, of just using "appXL" everywhere I ref "Application" in code and so you may see that in future postings of code snippets I copy/paste from working projects. -- Garry I did test it on the larger data amount and it too threw an error. It must be a cell limitation. I'll investigate that. Thanks for taking a look. Howard |
Code character limit with Resize or Transpose or cell?
It looks okay to me! It appears you are transfering data from one sheet to another, starting 1 row below existing data. Note my use of 'Application.Transpose' in place of 'WorksheetFunction.Transpose' is purely for the purpose of making my code VB^ friendly. It allows me to use Find/Replace for substituting my object var "appXL" for the ref to "Application". I'm in the process, though, of just using "appXL" everywhere I ref "Application" in code and so you may see that in future postings of code snippets I copy/paste from working projects. -- Garry I did test it on the larger data amount and it too threw an error. It must be a cell limitation. I'll investigate that. Thanks for taking a look. Howard There is a limit to the number of characters a cell can contain, but trying to put more than the limit into a cell just results the data being truncated (excess characters are trimmed off). I'm guessing by "larger amount of data" you mean record count as in size of the array containing the data. I find it easier to work with 2D arrays when dealing with worksheet data. When I said I use that code in my projects, I mostly use it when accessing a specific row or col of a 2D array via an inner 'Application.Index' function to specify which row or col I want to extract. Once done I dump the data into the target range. BOTH these functions work same as their WorksheetFunction counterpart! What I suspect you're trying to do is pull bits of data from a source as one might do in a db query, and trying to parse that data to various locations on a target sheet. How successfully this works depends greatly on how your data is structured AND how your source/target sheets' layout. Perhaps you can provide a sample that shows expected results on a copy of a target sheet so we can get the before/after as well! -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
All times are GMT +1. The time now is 07:20 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com