Hello Expertise,
I want to write VBA code for dragging excel Table range data dynamically to Right side column wise as per given date.
For eg. If I give Date for "Sep-19" in Worksheet it should automatically drag the table range to right containing Sept-19 data. I am Excel 2016 version.
Below is the table data:
<tbody>
</tbody>
I have tried some code, below the vba code for it:
Sub Macro4()
Range("Table1[[#Headers],[Month]]").Select
Selection.End(xlToRight).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.FillRight
Range("Table1[[#All],[Aug-19]:[Sep-19]]").Select
End Sub
I want the range "Aug-19]:[Sep-19]]" in last of code to be set up dynamic as per given month, how can I do it?
Thank you in advance.
I want to write VBA code for dragging excel Table range data dynamically to Right side column wise as per given date.
For eg. If I give Date for "Sep-19" in Worksheet it should automatically drag the table range to right containing Sept-19 data. I am Excel 2016 version.
Below is the table data:
Month | 18-Oct | Nov-18 | Dec-18 | 19-Jan | Feb-19 | Mar-19 | April-19 | May-19 | June-19 | July-19 | Aug-19 |
Cumulative Count | 10700 | 10810 | 10930 | 11050 | 11163 | 11210 | 11280 | 11350 | 11440 | 11550 | 19929 |
Devices | 570 | 575 | 582 | 592 | 5973 | 599 | 604 | 607 | 612 | 617 | 617 |
Connectors | 291 | 295 | 298 | 299 | 3027 | 305 | 306 | 308 | 310 | 314 | 314 |
Terminals | 209 | 211 | 213 | 214 | 2163 | 217 | 218 | 220 | 222 | 224 | 224 |
Rest | 9630 | 9729 | 9837 | 10268 | 100467 | 10089 | 10152 | 10225 | 10296 | 10395 | 18774 |
<tbody>
</tbody>
I have tried some code, below the vba code for it:
Sub Macro4()
Range("Table1[[#Headers],[Month]]").Select
Selection.End(xlToRight).Select
Range(Selection, Selection.End(xlDown)).Select
Selection.FillRight
Range("Table1[[#All],[Aug-19]:[Sep-19]]").Select
End Sub
I want the range "Aug-19]:[Sep-19]]" in last of code to be set up dynamic as per given month, how can I do it?
Thank you in advance.
Last edited: