I am looking to generate another sheet in the same work book with the data in the cells above. Is there a way to generate this by putting something that can be clicked on in Row K. For example, I want to only select lines 1 and 3 in the new sheet.
I am looking to generate another sheet in the same work book with the data in the cells above. Is there a way to generate this by putting something that can be clicked on in Row K. For example, I want to only select lines 1 and 3 in the new sheet.
Hello hatbox
There may be few options, one is to run a makro to insert a command button in column K, for all the rows that you have. Something like
Then you will need to add code for each button to copy row contents to where they are needed. The button number should be aligned to row number so you can increment that.![]()
Sub test() lastRow = Range("A1").End(xlDown).Row Range("K1").Select For n = 1 To lastRow rowLocation = ActiveCell.Left 'horizontal co-ord of cell colLocation = ActiveCell.Top 'vertical co-ord of cell ActiveSheet.OLEObjects.Add(ClassType:="Forms.CommandButton.1", Link:=False _ , DisplayAsIcon:=False, Left:=rowLocation, Top:=colLocation, Width:=43.2, Height:= _ 13.2).Select ActiveCell.Offset(1, 0).Select Next n End Sub
That said, it may be neater and more suitable to keep your worksheet tidy and write a makro that is assigned to a shortcut key, so when you are in the row to be copied, you can active it with the shortcut and it will copy the row values. Not sure if you want to copy the entire row of values or just everything up to column J.
Something like
and paste to sheet you need and location in the sheet![]()
ActiveCell.EntireRow.Select Selection.Copy
Regards
Last edited by hamjam; 11-13-2018 at 07:42 AM.
Most helpful to mark solved items as such (see help for directions). Star ratings are always welcome.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks