#### Zakky

##### Board Regular
Hi, Is it possible to change data format in Excel. My data in excel is as follows:

Name of GL GL Code Jan-19 Feb-19 Mar-19 Apr-19......until Dec-19
Salaries 8205 \$100 \$200 \$300 \$400 \$1200[/PHP][/HTML]
Tax 8206 \$10 \$20 \$30 \$40 \$120

I need to show it as follows:
Salaries 8205 Jan-19 \$100
Salaries 8205 Feb-19 \$200
Salaries 8205 Mar-19 \$300
Salaries 8205 Apr-19 \$400
all twelve months going down for every GL Code as there are hundreds of different GL codes

then new GL 8206 straight after GL 8205 in a continuous rows of data
Tax 8206 Jan-19 \$10
Tax 8206 Feb-19 \$200
Tax 8206 Mar-19 \$300
Tax 8206 Apr-19 \$400

Your help would be greatly appreciated as this will save me hours of work.

### Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

#### DanteAmor

##### Well-known Member
Assume your data begins in cell A1 on sheet1.
The result will remain on sheet2.

Try this

Code:
``````Sub Flip_data()
Dim sh1 As Worksheet, sh2 As Worksheet, c As Range, k As Long
Set sh1 = Sheets("Sheet1")
Set sh2 = Sheets("Sheet2")
sh2.Cells.Clear
k = 2
For Each c In sh1.Range("A2", sh1.Range("A" & Rows.Count).End(xlUp))
For j = 3 To 14
sh2.Cells(k, "A").Value = c
sh2.Cells(k, "B").Value = c.Offset(, 1)
sh2.Cells(k, "C").Value = sh1.Cells(1, j)
sh2.Cells(k, "D").Value = sh1.Cells(c.Row, j)
k = k + 1
Next
Next
MsgBox "End"
End Sub``````

#### Zakky

##### Board Regular
I can not believe my own eyes. This works like a dream. You VBA guys are god send and have amazing skills. I'm speechless, you have no idea how much time this has saved me.

MEGA MEGA BIG THANK YOU, DanteAmor

Last edited:

#### DanteAmor

##### Well-known Member
I can not believe my own eyes. This works like a dream. You VBA guys are god send and have amazing skills. I'm speechless, you have no idea how much time this has saved me.

MEGA MEGA BIG THANK YOU, DanteAmor

1,102,071
Messages
5,484,512
Members
407,444
Latest member
Trick

### This Week's Hot Topics

• Finding issue in If elseif else with For each Loop
Finding issue in If elseif else with For each Loop I have tried this below code but i'm getting in Y column filled with W005. Colud you please...
• MsgBox Error
Hi Guys, I have the below error show up when i try and run my macro in File1 but works fine if i copy and paste the same code into file2. [ATTACH...
• CELL FORMAT - IF CONDITION
My Cell Format is [B]""0.00" Cr". [/B]But in the cell, it is showing 123.00 for editing. (123 is entry figure). (Data imported from other...
• Show numbers nearly the same
Is this possible. I have a number that can change very time eg 0.00001234 Then I have a lot of numbers 0.0000001, 0.0000002, 0.00000004...