#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 61
Default dget and dsum

shift 1 shift 2 shift 3
1/1/2008 32 45 28
1/2/2008 49 36 73
1/3/2008 21 16 81

Have data as above and would like to make it as below:
1/1/2008 32
1/1/2008 45
1/1/2008 28
1/2/2008 49
1/2/2008 36
1/2/2008 73

Have 270 plus lines of data and have been trying to use dget but
can't seem to get it to work
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default dget and dsum

Try this macro (create Sheet2 before running!):

Sub test()
Dim sourcerng As Range, sourcecell As Range, oneRow As Range, destrng As
Range
Worksheets("Sheet1").Select
NoofRows = Range("A" & Rows.Count).End(xlUp).Row
Set sourcerng = Range("A2:A" & NoofRows)
destrow = 2
For Each sourcecell In sourcerng
Set oneRow = Range(Range("B" & sourcecell.Row), Range("D" &
sourcecell.Row))
oneRow.Copy
Worksheets("Sheet2").Select
Set destrng = Worksheets("Sheet2").Range(Range("A" & destrow),
Range("A" & destrow + 2))
destrng.Value = sourcecell.Value
Range("B" & destrow).Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone,
SkipBlanks:= _
False, Transpose:=True
Worksheets("Sheet1").Select
destrow = destrow + 3
Next sourcecell
Application.CutCopyMode = False
End Sub


Regards,
Stefi

Henry ezt *rta:

shift 1 shift 2 shift 3
1/1/2008 32 45 28
1/2/2008 49 36 73
1/3/2008 21 16 81

Have data as above and would like to make it as below:
1/1/2008 32
1/1/2008 45
1/1/2008 28
1/2/2008 49
1/2/2008 36
1/2/2008 73

Have 270 plus lines of data and have been trying to use dget but
can't seem to get it to work

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
DGET/DSUM etc ron_b Excel Worksheet Functions 2 March 16th 08 01:44 PM
dget or dsum criteria maffei Excel Worksheet Functions 1 April 27th 07 05:45 PM
dget or dsum? that is the question justaguyfromky Excel Discussion (Misc queries) 1 November 10th 05 03:10 AM
dget or dsum? that is the question bpeltzer Excel Discussion (Misc queries) 0 November 10th 05 12:30 AM
using dget Leslie Excel Worksheet Functions 0 June 24th 05 03:53 PM


All times are GMT +1. The time now is 01:08 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"