Insert same value across many cells

P

Pete

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
 
J

James Ravenswood

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top