ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   finding last non-blank cell and then copying it to the next cell (https://www.excelbanter.com/excel-discussion-misc-queries/173427-finding-last-non-blank-cell-then-copying-next-cell.html)

mike_vr

finding last non-blank cell and then copying it to the next cell
 
Hi there, bit of help needed please.

Should really know this, but say I have a column of data running from col A
to col x (any column really). I want to set up a macro that whenever it runs
it goes to the last column that has formulas (in this case a vlookup) in it,
copies and paste the formula into the next column and then copy and pastes
special values over the old data.
Tried using one of those auto macro things, and this is what I've come up
with to give you some sort of idea. Any ideas how to automatically find the
last non-blank column and then do the copy and paste thing?
Many thanks,
Mike

Range("T5:T11").Select
Selection.Copy
Range("U5").Select
ActiveSheet.Paste
Range("T5:T11").Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False


All times are GMT +1. The time now is 02:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com