Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Transfering 2D Array into 1D Array

Hello Excel Gurus,

I am currently preparing one database sheets and would like to perform
following action on the hit of couple of buttons,

I have two sheets name "entry" and "database" in a workbook.

I have two buttons on entry sheet called "transfer" and "call"

entry sheet has following cells/Ranges required to filled first time for
every new entry (all cells contain;Name or currency or number, etc)

("entry" sheet) Range "A1" and Range "A3:C7" (total 25 value in 2D array)

(Value in Range "A1" is important value and used to call all the value in
Range "A3:C7" from "database" sheet, lets say for an example Range"A1"=JIM)


when i fill above cells/Ranges in entry sheet and hit "transfer" button i
would like to to transfer all 26 value( Range A1 and 25 value from 2D array,
row by row) from "entry" sheet into "database" sheet in 1D Array format, such
as shown in below rage and clear all the cell value from "entry" sheet

"database" sheet
Range "A1:Z26"
(during the trasfer range A1 in entry sheet will be transfered in A1 in
database sheet, while entry sheet range "A3:C7" should transfer in database
sheet row by row, first row first and then second, so on)

Now if i type 'JIM' in Range "A1"(entry sheet) and hit "Call" button, i want
to bring all the same value in Range "A3:C7" (entry sheet) what i typed in
before and was stored in "database" sheet (Range"A1:Z26")

But if i type different value ( for an example "VIC" ) in Range "A1" (entry
sheet) and filled Range "A3:C7" (entry sheet) and hit "transfer" button, it
should transfer all 26 value in "database" sheet just above the existing
Range"A1:Z26" (So that alway recent data entered remains on the top row of
the "database" sheet)

As mentioned above, if i type "VIC" in cell A1 in entry sheet and hit "call"
button, it should fill all remaining value in Range "A3:C7" from "database"
sheet.

Please disregard worry of Uppercase or lowercase letter issues, I will be
restricting Range "A1" (entry sheet) by data validation.

Any Help, will be highly appriciated.

Many Thanks in advance,

Regards,
Learner



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Transfering 2D Array into 1D Array

this is a bit simplistic but gives you the idea:

Option Explicit

Sub Transfer()
Dim wsEntry As Worksheet
Set wsEntry = Worksheets("entry")
With Worksheets("database")
.Range("A1") = wsEntry.Range("A1")
.Range("B1:D1").Value = wsEntry.Range("A3:C3").Value
.Range("E1:F1").Value = wsEntry.Range("A4:C4").Value
.Range("G1:I1").Value = wsEntry.Range("A5:C5").Value
End With
End Sub



"Learner" wrote:

Hello Excel Gurus,

I am currently preparing one database sheets and would like to perform
following action on the hit of couple of buttons,

I have two sheets name "entry" and "database" in a workbook.

I have two buttons on entry sheet called "transfer" and "call"

entry sheet has following cells/Ranges required to filled first time for
every new entry (all cells contain;Name or currency or number, etc)

("entry" sheet) Range "A1" and Range "A3:C7" (total 25 value in 2D array)

(Value in Range "A1" is important value and used to call all the value in
Range "A3:C7" from "database" sheet, lets say for an example Range"A1"=JIM)


when i fill above cells/Ranges in entry sheet and hit "transfer" button i
would like to to transfer all 26 value( Range A1 and 25 value from 2D array,
row by row) from "entry" sheet into "database" sheet in 1D Array format, such
as shown in below rage and clear all the cell value from "entry" sheet

"database" sheet
Range "A1:Z26"
(during the trasfer range A1 in entry sheet will be transfered in A1 in
database sheet, while entry sheet range "A3:C7" should transfer in database
sheet row by row, first row first and then second, so on)

Now if i type 'JIM' in Range "A1"(entry sheet) and hit "Call" button, i want
to bring all the same value in Range "A3:C7" (entry sheet) what i typed in
before and was stored in "database" sheet (Range"A1:Z26")

But if i type different value ( for an example "VIC" ) in Range "A1" (entry
sheet) and filled Range "A3:C7" (entry sheet) and hit "transfer" button, it
should transfer all 26 value in "database" sheet just above the existing
Range"A1:Z26" (So that alway recent data entered remains on the top row of
the "database" sheet)

As mentioned above, if i type "VIC" in cell A1 in entry sheet and hit "call"
button, it should fill all remaining value in Range "A3:C7" from "database"
sheet.

Please disregard worry of Uppercase or lowercase letter issues, I will be
restricting Range "A1" (entry sheet) by data validation.

Any Help, will be highly appriciated.

Many Thanks in advance,

Regards,
Learner



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Transfering 2D Array into 1D Array

Patrick,

The reason i have asked with simple 2D array (three column and three row
only-9 cells) to understand the array lood and transfer macros.

Actually i have got 2D array of 14 rows and 14 columns (196 value), using
example you have given me would make things very tough. is there any other
solution we can implement using variable for assigning value,etc

let me know what do you think

cheers
Learner

"Patrick Molloy" wrote:

this is a bit simplistic but gives you the idea:

Option Explicit

Sub Transfer()
Dim wsEntry As Worksheet
Set wsEntry = Worksheets("entry")
With Worksheets("database")
.Range("A1") = wsEntry.Range("A1")
.Range("B1:D1").Value = wsEntry.Range("A3:C3").Value
.Range("E1:F1").Value = wsEntry.Range("A4:C4").Value
.Range("G1:I1").Value = wsEntry.Range("A5:C5").Value
End With
End Sub



"Learner" wrote:

Hello Excel Gurus,

I am currently preparing one database sheets and would like to perform
following action on the hit of couple of buttons,

I have two sheets name "entry" and "database" in a workbook.

I have two buttons on entry sheet called "transfer" and "call"

entry sheet has following cells/Ranges required to filled first time for
every new entry (all cells contain;Name or currency or number, etc)

("entry" sheet) Range "A1" and Range "A3:C7" (total 25 value in 2D array)

(Value in Range "A1" is important value and used to call all the value in
Range "A3:C7" from "database" sheet, lets say for an example Range"A1"=JIM)


when i fill above cells/Ranges in entry sheet and hit "transfer" button i
would like to to transfer all 26 value( Range A1 and 25 value from 2D array,
row by row) from "entry" sheet into "database" sheet in 1D Array format, such
as shown in below rage and clear all the cell value from "entry" sheet

"database" sheet
Range "A1:Z26"
(during the trasfer range A1 in entry sheet will be transfered in A1 in
database sheet, while entry sheet range "A3:C7" should transfer in database
sheet row by row, first row first and then second, so on)

Now if i type 'JIM' in Range "A1"(entry sheet) and hit "Call" button, i want
to bring all the same value in Range "A3:C7" (entry sheet) what i typed in
before and was stored in "database" sheet (Range"A1:Z26")

But if i type different value ( for an example "VIC" ) in Range "A1" (entry
sheet) and filled Range "A3:C7" (entry sheet) and hit "transfer" button, it
should transfer all 26 value in "database" sheet just above the existing
Range"A1:Z26" (So that alway recent data entered remains on the top row of
the "database" sheet)

As mentioned above, if i type "VIC" in cell A1 in entry sheet and hit "call"
button, it should fill all remaining value in Range "A3:C7" from "database"
sheet.

Please disregard worry of Uppercase or lowercase letter issues, I will be
restricting Range "A1" (entry sheet) by data validation.

Any Help, will be highly appriciated.

Many Thanks in advance,

Regards,
Learner



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
Prevent cell/array references from changing when altering/moving thecell/array nme Excel Discussion (Misc queries) 1 September 19th 08 01:53 PM
Redimming an array dynamically assigned from range (how to redim first dimension of a 2-D array? /or/ reverse the original array order) Keith R[_2_] Excel Programming 3 November 13th 07 04:08 PM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 6 November 9th 05 05:54 AM
Array problem: Key words-Variant Array, single-element, type mismatch error davidm Excel Programming 1 November 8th 05 04:21 AM


All times are GMT +1. The time now is 05:20 AM.

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

About Us

"It's about Microsoft Excel"