Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36

HELP FAST

This is a discussion on HELP FAST within the Excel Questions forums, part of the Question Forums category; ok guys heres the prob i want to make a button in excel, and wen i push the button i ...

  1. #1
    New Member
    Join Date
    Jun 2002
    Posts
    23

    Default

    ok guys

    heres the prob

    i want to make a button in excel, and wen i push the button i want to print just one row, and then i also want to have it ask me for the date wen i print a row, so then i know wen i printed it out, so can someone plz help me..

    this is like a database 4 a scool, and i was also wondering, is there a way so that wen i import my files from notepad that it would automatically alphabatize the text i just imported



    [ This Message was edited by: amirman2099 on 2002-06-21 10:10 ]

  2. #2
    New Member
    Join Date
    Jun 2002
    Posts
    48

    Default

    If i am getting what you need.. this should solve it pretty easy:

    Private Sub CommandButton1_Click()
    Worksheets("Shet1").Range("A4:C4").PrintOut
    End Sub

    just replace sheet1 with the name of your worksheet and range with the range you want to print.

    I dont know what you want with the date... do you want that to print also? or do you want it to be added into a cell in the workbook?

    [ This Message was edited by: tpgsr on 2002-06-21 11:01 ]

  3. #3
    New Member
    Join Date
    Jun 2002
    Posts
    23

    Default

    will i be able to like, make it so, that everytime i use a 'macro' it will ask me for the date, or just automatically put it in wen i print

    and i just want it to print a row

    with that thing u gave me, wen i use it, will it ask me wat row, or do i have to put the range in every time ???

    is there also a way for me to make a button Search just the first column for like a name or something, like i have 'last names' in the first column, so like is ther a way to make a button were if i push it, it will ask me wat im looking for and then i type in a last name, and then it will find it for me.

    i want it to be added into the cell and onto the printout

    [ This Message was edited by: amirman2099 on 2002-06-21 11:10 ]

  4. #4
    New Member
    Join Date
    Jun 2002
    Posts
    23

    Default

    do anyone know ?

  5. #5
    New Member
    Join Date
    Jun 2002
    Posts
    48

    Default

    with a little tweaking this can search the first column to find a name, and it will select that row from A:G (I dont exactly know how to select the whole row ') then if you combine this code with the print out code you will ahve your project.... oh and it adds the date in column G... You will need to change the column letters and the number of times the for statement loops etc... (lots of tweaking)

    Private Sub CommandButton1_Click()
    Dim FindName
    Dim IsFound As Boolean
    IsFound = False

    FindName = InputBox("Enter the last name", Find)

    For x = 1 To 40 'replace 40 with the number of rows in the sheet
    If Worksheets("test").Range("a" + CStr(x)) = FindName Then
    IsFound = True
    Exit For
    End If
    Next

    x = CStr(x)

    If IsFound Then
    Worksheets("test").Range("A" + x + ":G" + x).Activate
    Else
    MsgBox "Name not found", vbOKOnly
    End If

    Worksheets("Test").Range("G" + x).Value = InputBox("enter the date")
    End Sub

  6. #6
    New Member
    Join Date
    Jun 2002
    Posts
    23

    Default

    were do i type all of that into ??

    into a cell ?



  7. #7
    New Member
    Join Date
    Jun 2002
    Posts
    48

    Default

    create a button, and while in design mode right click on it and hit view code you will see that what it shows you matches the first and last lines of my code.... copy and paste my code in that window in between those two lines, and delete the duplicated line (Eg: "command button1_*******", and "End sub")

    [ This Message was edited by: tpgsr on 2002-06-21 11:37 ]

  8. #8
    New Member
    Join Date
    Jun 2002
    Posts
    23

    Default

    after i go to view code, and put all the stuff in, do i just hit save or wat, i put it in and now im stuck again...

  9. #9
    New Member
    Join Date
    Jun 2002
    Posts
    23

    Default

    now wen i view the source of the button it looks like this:

    Private Sub CommandButton1_Click()
    Dim FindName
    Dim IsFound As Boolean
    IsFound = False

    FindName = InputBox("Enter the last name", Find)

    For x = 1 To 17
    If Worksheets("test").Range("a" + CStr(x)) = FindName Then
    IsFound = True
    Exit For
    End If
    Next

    x = CStr(x)

    If IsFound Then
    Worksheets("test").Range("A" + x + ":G" + x).Activate
    Else
    MsgBox "Name not found", vbOKOnly
    End If

    Worksheets("Test").Range("G" + x).Value = InputBox("enter the date")
    End Sub



    but why wont it let me push the button and see if it works?

  10. #10
    New Member
    Join Date
    Jun 2002
    Posts
    48

    Default

    on the tool bar, you need to take excel out of design mode

Page 1 of 4 123 ... LastLast

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
  •  


DMCA.com