Below is the vba code for copying a data and then pasting it at the next empty line after the present data and then deleting the original data so that when i come back next time i can input data in the sheet again and do it again and again.
one problem is when it is my first time it goes to the end of the column b. so i wanted to keep a check and do it accordingly. Can you recommend the code for me? thanks
Code:Sub Macro1() Dim jpt As Worksheet Dim i As Worksheet Dim sheet1 As Worksheet Sheets("jpt").Activate Sheets("jpt").Range("b3").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select Selection.Copy Sheets("i").Activate Range("B3").Select If Selection.Offset(1, 0) = "" Then ActiveSheet.paste Else Selection.End(xlDown).Offset(1, 0).Select ActiveSheet.paste End If Sheets("jpt").Activate Sheets("jpt").Range("b3").Select Range(Selection, Selection.End(xlToRight)).Select Range(Selection, Selection.End(xlDown)).Select Selection.Delete End Sub




Reply With Quote
Bookmarks