Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default URGENT: Alan Beban - SubArray not working - any thoughts?

Alan -

For some reason, my project is going backwards,
or at least it feels that way.

I have the following:

Sub .... ()

Dim rng As Range
Dim aTemp
Range("A1").Select
ActiveCell.CurrentRegion.Select
r = Selection.Rows.Count
c = Selection.Columns.Count
Set rng = Range("A1").CurrentRegion
aTemp = rng.Value
Sheets.Add
Set rng = Range("A1").Range(Cells(1,1),Cells(r,c)).Select
rng.Resize(r,c).Values = SubArray(aTemp,1,c,1,r)

End Sub

I try it now on a single file - hoping that in effect all it would do
is read the range into an array and then write it back out to a
different worksheet.

When I watch the subroutine, it appears to do everything correct but
the line with SubArray.

Any thoughts?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default URGENT: Alan Beban - SubArray not working - any thoughts?

Marston wrote:
Alan -

For some reason, my project is going backwards,
or at least it feels that way.

I have the following:

Sub .... ()

Dim rng As Range
Dim aTemp
Range("A1").Select
ActiveCell.CurrentRegion.Select
r = Selection.Rows.Count
c = Selection.Columns.Count
Set rng = Range("A1").CurrentRegion
aTemp = rng.Value
Sheets.Add
Set rng = Range("A1").Range(Cells(1,1),Cells(r,c)).Select
rng.Resize(r,c).Values = SubArray(aTemp,1,c,1,r)

End Sub

I try it now on a single file - hoping that in effect all it would do
is read the range into an array and then write it back out to a
different worksheet.

When I watch the subroutine, it appears to do everything correct but
the line with SubArray.

Any thoughts?

Bite your tongue! Your problems don't have anything to do with the
SubArray function. Drop the .Select in the next to last line (I can't
believe that that line, as included above, does not throw an Object
required error, rather than doing everything correct), and in the last
line change "Values" to "Value"; you misinferred that because there was
a problem on this last line it resided in the SubArray function.

Alan Beban
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default URGENT: Alan Beban - SubArray not working - any thoughts?

Actually the odd thing was - even though I didn't have an On Error
Resume Next in my subroutine,
it was running all the way through and sat there and watched just
about every darn variable.
(the Values was a typo not in the code by the way).
For some reason, it really looked like everything was loading into the
array aTemp
but when I tried to put in through SubArray, it came back with
nothing.

At the end of the day, even after I corrected the .Select it still
didn't work.

The solution was to unload another program I had in Excel that is the
D/B query tool from our ERP tool to Excel. For whatever reason, it was
keeping all sorts of things from executing.

Thanks for your response.



Alan Beban wrote in message ...
Marston wrote:
Alan -

For some reason, my project is going backwards,
or at least it feels that way.

I have the following:

Sub .... ()

Dim rng As Range
Dim aTemp
Range("A1").Select
ActiveCell.CurrentRegion.Select
r = Selection.Rows.Count
c = Selection.Columns.Count
Set rng = Range("A1").CurrentRegion
aTemp = rng.Value
Sheets.Add
Set rng = Range("A1").Range(Cells(1,1),Cells(r,c)).Select
rng.Resize(r,c).Values = SubArray(aTemp,1,c,1,r)

End Sub

I try it now on a single file - hoping that in effect all it would do
is read the range into an array and then write it back out to a
different worksheet.

When I watch the subroutine, it appears to do everything correct but
the line with SubArray.

Any thoughts?

Bite your tongue! Your problems don't have anything to do with the
SubArray function. Drop the .Select in the next to last line (I can't
believe that that line, as included above, does not throw an Object
required error, rather than doing everything correct), and in the last
line change "Values" to "Value"; you misinferred that because there was
a problem on this last line it resided in the SubArray function.

Alan Beban

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Has anyone used arrayfunctions from Alan Beban? SteveT Excel Worksheet Functions 3 February 26th 07 07:52 AM
VlookupS-Alan Beban Deeds Excel Worksheet Functions 4 December 20th 05 12:03 AM
Vlookups array function by Alan Beban falvey3 Excel Worksheet Functions 1 February 17th 05 01:21 PM
Array Functions from Alan Beban Josh O. Excel Worksheet Functions 13 February 5th 05 12:54 AM


All times are GMT +1. The time now is 12:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"