Hello Sirs,
Need your help in selecting Cells in using Macros. The below Macro is creating using simple Record Macro option. Help I need is as below:
1) In the below selection I have simply pressed record Macro and done CTRL+A.
2) Right now there is data till column DI. Tomorrow there will be data till column DJ and Tuesday till DK.. and so on.
3) Today this macro will work fine. But after today it will skip data.
What need I do, to make it select all active cells which will dynamically change or increase every day.
Below is the code.
Please help.. Thanks..
==============================================================================================
Sub MrExcel1()
'
' MrExcel1 Macro
'
' Keyboard Shortcut: Ctrl+Shift+Z
'
Range("A1:DI267").Select
Selection.AutoFilter
Range("E1").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets.Add After:=ActiveSheet
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Sheets("time_series_covid19_confirmed_g").Select
Range("DA1").Select
Range(Selection, Selection.End(xlToLeft)).Select
ActiveSheet.Range("$A$1:$DI$267").AutoFilter Field:=2, Criteria1:="India"
Range("E133").Select
Range(Selection, Selection.End(xlToRight)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("C2").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("E2").Select
Sheets("time_series_covid19_confirmed_g").Select
Range(Selection, Selection.End(xlToLeft)).Select
ActiveSheet.Range("$A$1:$DI$267").AutoFilter Field:=2, Criteria1:="US"
Range("E227").Select
Range(Selection, Selection.End(xlToRight)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Need your help in selecting Cells in using Macros. The below Macro is creating using simple Record Macro option. Help I need is as below:
1) In the below selection I have simply pressed record Macro and done CTRL+A.
2) Right now there is data till column DI. Tomorrow there will be data till column DJ and Tuesday till DK.. and so on.
3) Today this macro will work fine. But after today it will skip data.
What need I do, to make it select all active cells which will dynamically change or increase every day.
Below is the code.
Please help.. Thanks..
==============================================================================================
Sub MrExcel1()
'
' MrExcel1 Macro
'
' Keyboard Shortcut: Ctrl+Shift+Z
'
Range("A1:DI267").Select
Selection.AutoFilter
Range("E1").Select
Range(Selection, Selection.End(xlToRight)).Select
Selection.Copy
Sheets.Add After:=ActiveSheet
Range("A2").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Sheets("time_series_covid19_confirmed_g").Select
Range("DA1").Select
Range(Selection, Selection.End(xlToLeft)).Select
ActiveSheet.Range("$A$1:$DI$267").AutoFilter Field:=2, Criteria1:="India"
Range("E133").Select
Range(Selection, Selection.End(xlToRight)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Range("C2").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True
Range("E2").Select
Sheets("time_series_covid19_confirmed_g").Select
Range(Selection, Selection.End(xlToLeft)).Select
ActiveSheet.Range("$A$1:$DI$267").AutoFilter Field:=2, Criteria1:="US"
Range("E227").Select
Range(Selection, Selection.End(xlToRight)).Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=True