Good Evening, I'm still fairly new to VBA and my googling hasn't gotten me results. I'm trying to move data from 3 columns to a different 3 columns, same workbook and sheet, even the same row. The column data is being moved to depends on what is in the first column, from what I can tell this requires a Case statement. I've entered 3 of the values in my code so far and when I run the macro nothing actually happens. See code below.
This is the desired outcome:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Column 1[/TD]
[TD]Column 2[/TD]
[TD]Column 3[/TD]
[TD]Column 4[/TD]
[TD]Column 5[/TD]
[TD]Column 6[/TD]
[TD]Column 7[/TD]
[TD]Column 8[/TD]
[TD]Column 9[/TD]
[/TR]
[TR]
[TD]CA1[/TD]
[TD]$3[/TD]
[TD]$8[/TD]
[TD]here[/TD]
[TD]here[/TD]
[TD]here[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CA1[/TD]
[TD]$5[/TD]
[TD]$7[/TD]
[TD]here[/TD]
[TD]here[/TD]
[TD]here[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PA10[/TD]
[TD]$8[/TD]
[TD]$9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]here[/TD]
[TD]here[/TD]
[TD]here[/TD]
[/TR]
[TR]
[TD]PA12[/TD]
[TD]$13[/TD]
[TD]$19[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]here[/TD]
[TD]here[/TD]
[TD]here[/TD]
[/TR]
</tbody>[/TABLE]
This is where I was getting my information from and I'm sure it's lacking context that I'm not able to determine: https://www.techonthenet.com/excel/formulas/case.php
Code:
Sub MoveTax()
Select Case Column1
Case "CA1"
Range("A:C").Cut Range("D:F")
Case "PA12"
Range("A:C").Cut Range("G:I")
Case "PA10"
Range("A:C").Cut Range("G:I")
End Select
End Sub
This is the desired outcome:
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Column 1[/TD]
[TD]Column 2[/TD]
[TD]Column 3[/TD]
[TD]Column 4[/TD]
[TD]Column 5[/TD]
[TD]Column 6[/TD]
[TD]Column 7[/TD]
[TD]Column 8[/TD]
[TD]Column 9[/TD]
[/TR]
[TR]
[TD]CA1[/TD]
[TD]$3[/TD]
[TD]$8[/TD]
[TD]here[/TD]
[TD]here[/TD]
[TD]here[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]CA1[/TD]
[TD]$5[/TD]
[TD]$7[/TD]
[TD]here[/TD]
[TD]here[/TD]
[TD]here[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]PA10[/TD]
[TD]$8[/TD]
[TD]$9[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]here[/TD]
[TD]here[/TD]
[TD]here[/TD]
[/TR]
[TR]
[TD]PA12[/TD]
[TD]$13[/TD]
[TD]$19[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]here[/TD]
[TD]here[/TD]
[TD]here[/TD]
[/TR]
</tbody>[/TABLE]
This is where I was getting my information from and I'm sure it's lacking context that I'm not able to determine: https://www.techonthenet.com/excel/formulas/case.php