CODE Assistance needed PLEASE please please

N

N.F

Hi. Anyone can disect this code and see whats wrong with it. When I hit
debug, it highlights the 5th line in the first paragraph.
I need the listbox in sheet1 to get the values in sheet ("database") and
once I click the command button in the userform I need it to display the list
values in ListBox1 on an array style ( a row with the values) on sheet 1.
This is what I came up with:
I just cant get the values selected in the listbox to show in a row style in
sheet 1.


Public Sub Closefrm1_Click()
NumColumns= ListBox1.ListCount
Set rng=Sheet1.Range("Header")
rng.Clear
rng.Resize(1,NumCoulumns).Name=Sheet1.Range("Header")

k=0
For Each cell in Sheet1.Range("Header")
Cell.Value=ListBox1.List(k)
K=K+1

ListBox1.Clear
ListBox2.Clear

UserForm1.Hide
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