Insert same value across many cells
I have 2 values that are taken from an Inputbox that I need to copy
across a range of cells what would be the best and most efficient way to do this? I need the values to be inserted into column A & B from the next Blank Cell in Column A Thanks Peter |
Insert same value across many cells
On Aug 7, 4:09*pm, Pete wrote:
I have 2 values that are taken from an Inputbox that I need to copy across a range of cells what would be the best and most efficient way to do this? I need the values to be inserted into column A & B from the next Blank Cell in Column A Thanks Peter Perhaps something like: Sub AB() Dim A As Range, B As Range n = Cells(Rows.Count, "A").End(xlUp).Row + 1 Set A = Range("A" & n) n = Cells(Rows.Count, "B").End(xlUp).Row + 1 Set B = Range("B" & n) vA = Application.InputBox(Prompt:="Give a value for column A", Type:=1) vB = Application.InputBox(Prompt:="Give a value for column B", Type:=1) A.Value = vA B.Value = vB End Sub |
All times are GMT +1. The time now is 11:02 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com