+ Reply to Thread
Results 1 to 4 of 4

autofill+addrows+lookup

  1. #1
    Registered User
    Join Date
    07-17-2006
    Posts
    54

    autofill+addrows+lookup

    hi,

    i need some help with a macro! i got a database with 3 columns. In the first one there is date, in the second names and in the last one, values. it looks like that :
    2006-01-01 U 1,00
    2006-01-02 U 1,89
    .
    .
    2006-12-31 U 1,56
    2006-01-01 A 2,01
    2006-01-02 A 0.09
    .
    .
    2006-12-31 A 1.34
    and so on...
    I need to be able to change all date (like a switch between 2006 and 2007), and to be able to add a new name with the right number of row for the studied year. I tried with a userform, but i'm stuck in the year change and the rows adding!

    Sub Macro2()
    Range("A2").AutoFill Destination:=Range("A2:A" & Range("B" & Rows.Count).End(xlUp).Row), Type:=xlFillDefault
    Range("B2").AutoFill Destination:=Range("B2:B" & Range("B" & Rows.Count).End(xlUp).Row), Type:=xlFillDefault
    End Sub

    that's my code...but dont know how to make it works in a userform...and the code is not working like i would like(if the name in column 2 is something like U 1, in the next row it puts U 2 and so on!)
    Last edited by mhax; 06-14-2007 at 09:45 AM.

  2. #2
    Registered User
    Join Date
    07-17-2006
    Posts
    54
    do you guys need more info or clarifications?

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Please read forum rules below and then wrap your code

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    07-17-2006
    Posts
    54
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1