Copy & Paste Data to certain Range

  • Re: Copy & Paste Data to certain Range


    Hey Z


    try...

  • Re: Copy & Paste Data to certain Range


    reading question add this bit too

    Code
    Private Sub CommandButton1_Click()
        Dim iCount As Long
        For iCount = 1 To TextBox2.Value + 1
            Range("C" & Cells(Rows.Count, 3).End(xlUp).Row + 1).Value = Me.ListBox1.Value
        Me.ListBox1.ListIndex = Me.ListBox1.ListIndex + 1 ' add this line
        Next iCount
    End Sub
  • Re: Copy & Paste Data to certain Range


    Good Morning pike
    Can't make it work, maybe I did not explain want I want very good. (Sorry). What I'm looking to do is select a date in the listbox and have it paste the data in textbox1 in sheet2 column C in line with that date. If it was a birthday and I wand it for the next 10 years I would select yearly and set the spinbutton on 10. It would look for the next 10 dates on sheet2 with the select date and paste it in. So if I selected 8/1 and put Ricks Birthday in textbox1 and set the repeat times it would paste it in the right place. I hope I explained better.
    Z

  • Re: Copy & Paste Data to certain Range


    Hi Pike
    This is part of a event Calendar, so the repeat would be number of time to repeat event. The textbox1 value should go in sheet2 in the right row of the date. If I put Hello on 7/30 it would go to row 22, if the repeat was set at 3 it would paste textbox1 in row 22,387,752. Hope this is clearer
    Z

  • Re: Copy & Paste Data to certain Range


    Test this

  • Re: Copy & Paste Data to certain Range


    156 Views, someone most have a idea to make this work. When you select a date in listbox, then put text in the textbox it go to the date selected on sheet2 in the correct date. Not even
    sure if this is possible?


    Z

  • Re: Copy & Paste Data to certain Range


    the code works for me


    so many views with no responce cam mean .. you need to explain more as no one understands your request
    or somethimes it because op notice you dont want help but for someone to do the work for you

  • Re: Copy & Paste Data to certain Range


    Hello Pike
    I do very much appreciate all your help on this, the reason I'm asking questions is because I do not know how to make this work. I hardy every ask a question twice, when I get
    a answer I study and try to understand how it works. I save all my questions for future references. You are right it saves to column C the number of times the event is set. Maybe I went at this all wrong because
    its not exactly what I'm looking for.
    1. Select date in listbox
    2. Input text in Data Fill Box
    3. Set number of times for the event
    4. Summit


    Here is the problems
    When you select a date in list box and input data and set the event time it should only paste in the correct dates. So If I select 7/12 in the listbox and put Fred's Birthday in Data Fill box and set event
    box to 20 times it should paste only in 7/12 values. I have a 7/12 for 2013 and 7/12 for 2014 and so on. So it should start at date selected and go forward 20 times, hope this is a better way to
    explain it. You should be able to have more than 1 event per select date, if 4 people had the same birthday they all show up.The reason I have two column of dates is because different formats to search out date I hope. If you selected monthy and selected 1-Aug and set the event to 4 times it should paste in 1-Aug,1Sep,1Nov and so on. Hope I explained it better, still not sure its possible. I have search Google for a lot of hours trying to find something like this.
    I appreciate any help I can get on this.
    Z


    Just notice on the form Monthly works perfect, Yearly is where the problem is at. Wonder if there is a way when you select a date and it has a event already its shows up in Data Fill Box ?

  • Re: Copy & Paste Data to certain Range


    no just need a tweak with the format of the listbox value try....

  • Re: Copy & Paste Data to certain Range


    Thanks pike
    Just tested and looks good,you did a nice job on this code. I will play around on a couple more items,maybe show the event in the Data Fill box when a date is selected. This way I think
    I will be able to add more events to a day and not erase the event there now.
    Z

  • Re: Copy & Paste Data to certain Range


    you can shorten the code or refine the ifs

  • Re: Copy & Paste Data to certain Range


    Thanks pike
    Did not get the last code to do anything, I will try and work out the bugs. Need to find a way so it does not erase a event if another event is added for that day? Not sure if I can have Data Fill box show events when a date is selected after moving around dates. So if I went to Sept then back to july 12 and it had a event it would show in the Data Fill Box.
    Z

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!