Hi, I am seeking your help with creating a macro that will delete a Col C, insert a Col A, then name it,then populate the rows to end of data in next col with user input.
Please see example in attachment.
Thanks,
cgannm Attachment 9212
Hi, I am seeking your help with creating a macro that will delete a Col C, insert a Col A, then name it,then populate the rows to end of data in next col with user input.
Please see example in attachment.
Thanks,
cgannm Attachment 9212
[vba]
Sub SomeCode()
Dim myInput As Variant
myInput = InputBox("Insert what type?")
If myInput <> "" Then
Columns(3).Delete
Columns(1).Insert
Range("A1").Value = "Tray"
Range("A2").Resize(Range("B2").End(xlDown).Row).Value = myInput
End If
End Sub
[/vba]
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Hi, Xid,thanks for helping. I am have one slight problem with "A2". The input value is populating one too rows. For example, "B2" has data up to row 10, script populates "A2" up to Row 11.
Thanks
Slight mod
[vba]
Sub SomeCode()
Dim myInput As Variant
myInput = InputBox("Insert what type?")
If myInput <> "" Then
Columns(3).Delete
Columns(1).Insert
Range("A1").Value = "Tray"
Range("A2").Resize(Range("B2").End(xlDown).Row - 1).Value = myInput
End If
End Sub
[/vba]
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber