Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Dumping Data


My current code isnt quite working.
I am trying to get A Range of cells from Row 1 in current sheet into
Column A in "TS Total" Worksheet, the actula range differs, depending
on values of firstcol and lastcol.

Here lastcol = 20 and firstcol = 10

Sheets("Weekly").Select
Sheets.Add.Name = "TS TOTAL"

For i = firstcol + 1 To lastcol - 1 Step 1
Cells(1, i) = Worksheets("TS TOTAL").Cells(i, 1)
Next

Many Thanks


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=566977

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Dumping Data

If you are trying to set the value of the cell in Worksheets("TS TOTAL"),
then it needs to be on the left of the "=".
But can you not use TRANSPOSE with your range ?
Range("A1:A2") = WorksheetFunction.Transpose(Range("B1:C1"))

NickHK

"T De Villiers"
wrote in message
news:T.De.Villiers.2buy1p_1154429704.7144@excelfor um-nospam.com...

My current code isnt quite working.
I am trying to get A Range of cells from Row 1 in current sheet into
Column A in "TS Total" Worksheet, the actula range differs, depending
on values of firstcol and lastcol.

Here lastcol = 20 and firstcol = 10

Sheets("Weekly").Select
Sheets.Add.Name = "TS TOTAL"

For i = firstcol + 1 To lastcol - 1 Step 1
Cells(1, i) = Worksheets("TS TOTAL").Cells(i, 1)
Next

Many Thanks


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile:

http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=566977



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Dumping Data

When you add a sheet, it now becomes the active sheet... so when you
use your short hand notation of just cells(1,i), you are most likely
setting the values on the "TS TOTAL" sheet... Have to be careful with
the select and active sheet method... always using the complete call of
worksheet.cells() is a good habit.

I agree using the transpose would be a lot easier and faster if its
applicable here.


NickHK wrote:
If you are trying to set the value of the cell in Worksheets("TS TOTAL"),
then it needs to be on the left of the "=".
But can you not use TRANSPOSE with your range ?
Range("A1:A2") = WorksheetFunction.Transpose(Range("B1:C1"))

NickHK

"T De Villiers"
wrote in message
news:T.De.Villiers.2buy1p_1154429704.7144@excelfor um-nospam.com...

My current code isnt quite working.
I am trying to get A Range of cells from Row 1 in current sheet into
Column A in "TS Total" Worksheet, the actula range differs, depending
on values of firstcol and lastcol.

Here lastcol = 20 and firstcol = 10

Sheets("Weekly").Select
Sheets.Add.Name = "TS TOTAL"

For i = firstcol + 1 To lastcol - 1 Step 1
Cells(1, i) = Worksheets("TS TOTAL").Cells(i, 1)
Next

Many Thanks


--
T De Villiers
------------------------------------------------------------------------
T De Villiers's Profile:

http://www.excelforum.com/member.php...o&userid=26479
View this thread: http://www.excelforum.com/showthread...hreadid=566977


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Dumping Data


Thanks guy

--
T De Villier
-----------------------------------------------------------------------
T De Villiers's Profile: http://www.excelforum.com/member.php...fo&userid=2647
View this thread: http://www.excelforum.com/showthread.php?threadid=56697

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
Looping & Dumping teresa Excel Programming 2 January 1st 05 01:43 PM
Dumping Clipboard Memory ianripping[_95_] Excel Programming 1 September 3rd 04 09:54 AM
Dumping multi demensioned array into excel ExcelMonkey[_62_] Excel Programming 2 February 3rd 04 06:45 PM
Help with dumping data Tom Ogilvy Excel Programming 0 November 14th 03 02:34 AM
Dumping the contents of a VBA array to a sheet Dave[_15_] Excel Programming 6 August 9th 03 02:35 AM


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

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"