Posts by DANDERSON

    This is my guess to my problem.
    I have data theat is in one sheet.
    I have written some code to import data, and place it in row 5000, then I do a sort to consolidate the data. I then run a combine routine to consolidate the data. The cells in between rows 100-5000 appear to be empty, but I think something must be there. I do not know what because all I do is insert maybe 20 rows at row 5000. Reason is I do not currently know how to determine the current last row, then insert. Maybe this is a better approach.


    I am including the Excel file.


    Again, this group is wonderful, and I appreciate any support.

    I am trying to reference a cell [L1] (value:8/7/2004), and run a saveas.
    Problem is, L1 is a date, and does not format the filename correctly, and omits the date:



    I know how to save a filename with the current date:
    ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & Format(Date, "yyyy-mmm-d") & " Timesheet.xls" (which gives:2004-Aug-9 Timesheet.xls"


    I wish to have be the outcome of cell L1: 2004-Aug-7 Timesheet.xls


    '-------------------------
    'Code I have:


    Dim newDate 'As Range
    newDate = ActiveCell.Value
    Range("L1").Select
    Application.DisplayAlerts = False ' Without asking permission
    ActiveWorkbook.SaveAs Filename:=ThisWorkbook.Path & "\" & newDate & " Timesheet.xls", FileFormat:=xlNormal, _
    Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
    CreateBackup:=False
    Application.DisplayAlerts = True ' Turning it back on
    '-------------------------
    Thanks!

    Work Around


    I found a work around by creating a bogus data line that would always be sorted first, that wat the QTY would count up right, then I just delete the bogus data at the end, but since I am learning, I was hoping somebody could explain why?


    Thanks everyone.

    1st Item's QTY will not add up? Puzzled, can't determine why.


    I am done coding my entire app and checking values, and notice that the first line of the data does not add up the QTY, it combines it ok. I cant seem to figure it out.


    Just look at the file attached in the previous post for code and data: Group & Add v2.xls


    If you look at the original data:
    16 4 2 9 40209
    16 4 2 9 40209
    16 4 2 9 40209


    3 rows should add up to QTY=48, but sorted data reads 16 on DATA tab.


    I ran a few tests and it seems that the 1st sorted item is the only one not adding up. Any help is appreciated. Thanks! I'll keep workin gon it.

    Sweet! Thanks, Good approach I did not think of.


    Thank you very much. I have just found this forum, and I love it. I just started writing VB, and have learned a great deal. There are many talented people here including yourself. Thanks again, and have a great day.


    :thanx:

    I have to say thanks to everyone here helping us newbies! I have searched the group and learned how to code to delete a sheet, but I wish to delete a range between known sheets. Is this possible?


    I have many sheets , 1-5 do not move when I sort. I sort 6-last.
    6 name = 0000a000
    last sheet name =9999z999


    I want to delete all sheets between them.


    :thanx: Again!

    Thats IT!!!


    Wow, that was a simple modification!!! That is exactly the outcome I needed! Thanks again. I am just so happy. I have been writing this code for 3 days now, and that was the last part I need to figure out. Now I can finish it up, and move on to learn more. I have been learning to write AutoCAD to Excel. This is great!


    :thanx:

    Outstanding!!! Thank you all. I have made a mistake in my interpretation of what needed to be done. The BAR FT IN MARK need to be left alone, just combined, and the QTY is the only column that needs to be added up....I did not think I would have had so much to work with. I will try to look at the code and work with it to modify it. Thanks again. I REALLY appreciate it. If you have a simple modification fix, please dont hesitate. I am really new to this wonderful world of VB, and now can appreciate the fun that can be placed back into Excel.


    :thanx:

    I am not sure exactly of the syntax I should be looking for in these forums. I am new to VB, so flame on, I dont mean to be lame.


    I want to take the data, as seen below, and combine all the like Bar MArk's, into one line, and add up the QTY, FT & IN columns. The Bar Size column will not be added up. I would also like to get rid of the zeros. I will be doing this hundreds of times a month, so any help is GREATLY appreciated.


    I have the following table:


    QTY BAR SIZE FT IN BAR MARK
    4 -- 3 10 RCBC1
    4 -- 3 10 RCBC1
    4 -- 3 10 RCBC1
    2 6 7 3 MK646
    2 6 7 3 MK646
    2 6 7 3 MK646
    3 6 4 5 MK642
    3 6 4 5 MK642
    3 6 4 5 MK642
    1 6 4 6 MK641
    1 6 4 6 MK641
    1 6 4 6 MK641
    8 6 2 1 MK631
    8 6 2 1 MK631
    8 6 2 1 MK631
    25 4 6 9 MK405
    25 4 6 9 MK405
    25 4 6 9 MK405
    46 4 2 6 MK404
    46 4 2 6 MK404
    46 4 2 6 MK404
    46 4 7 9 MK402
    46 4 7 9 MK402
    46 4 7 9 MK402
    4 11 49 2 114902
    4 11 49 2 114902
    4 11 49 2 114902
    2 8 14 3 81403
    2 8 14 3 81403
    2 8 14 3 81403
    6 8 5 2 80502
    6 8 5 2 80502
    6 8 5 2 80502
    16 4 2 9 40209
    16 4 2 9 40209
    16 4 2 9 40209
    0 0 0 0 0
    0 0 0 0 0
    0 0 0 0 0
    0 0 0 0 0
    0 0 0 0 0
    0 0 0 0 0
    0 0 0 0 0
    0 0 0 0 0



    Here is an example of the outcome I would like:


    4 -- 3 10 RCBC1
    4 -- 3 10 RCBC1
    4 -- 3 10 RCBC1


    would turn into this:


    12 0 9 30 RCBC1


    And so on...and deleteing the ZEROS at the bottom..


    Is this possible?

    Thanks for the help!


    I ended up creating a sheet "0" and a sheet "9999z99"
    then I hide the two new sheets so they would not interfere with the user, and then ran the =SUM('0:9999z99'!A$1).


    I will be able to apply this, and the hide sheet for many applications I need.


    I appreciate the help again!
    :thanx:

    I wish to have a workbook, that gets updated regularly with new data. I wish to ceate a totals sheet that has the ability to take data from a particular cell, in every sheet in the workbook.


    All sheets are formated the same.


    i.e. I want to add up all [A:1] cells in every sheet.
    trouble is, the number of sheets grows on a daily basis. How do I formulate a variable to determined the number of sheets first? then add up the current amount of data in eash sheet? Is there a better approach?


    Thanks in advance. I tried to do a search, but I am not exactly sure what syntax I should be looing for.


    I am new to VB, so please explain in easy terminology.