Hi all
I'm trying to find the right code to overwrite the values (regardless of what they are, so find/replace does not work) in a specified column (say column W) of an already selected range of cells with a static value number (say "100"). I've tried various things but nothing seems to work! I don' want the code to replace the value in all cells in that column, just in the range of cells (rows) selected, which were selected from having being pasted in in the previous part of the VBA below.
Here is the VBA I have already which selects rows of entries in a journal and then copies and pastes those same rows below the last populated row. The idea is that the copied and pasted set is the reversals for the journal (at the end of this code the applicable rows where the value in column W needs to be replaced by 100 are already selected):
I'm trying to find the right code to overwrite the values (regardless of what they are, so find/replace does not work) in a specified column (say column W) of an already selected range of cells with a static value number (say "100"). I've tried various things but nothing seems to work! I don' want the code to replace the value in all cells in that column, just in the range of cells (rows) selected, which were selected from having being pasted in in the previous part of the VBA below.
Here is the VBA I have already which selects rows of entries in a journal and then copies and pastes those same rows below the last populated row. The idea is that the copied and pasted set is the reversals for the journal (at the end of this code the applicable rows where the value in column W needs to be replaced by 100 are already selected):
VBA Code:
Sub Reverse_Charges_Against_CandB()
Application.ScreenUpdating = False
Sheets("BL Core Posting Import").Select
Rows("5:5").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
Dim lastrow As Long
lastrow = Range("O65536").End(xlUp).Row
Sheets("BL Core Posting Import").Activate
Cells(lastrow + 1, 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Application.ScreenUpdating = True
End Sub