Results 1 to 14 of 14

Changing Column values with VB code

Threaded View

  1. #1
    Forum Contributor 00Able's Avatar
    Join Date
    11-17-2010
    Location
    Pittsburgh, PA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    244

    Changing Column values with VB code

    I dont understand vb at all apparently....

    ok this code works:
     For i = 1 To 18
                iRow = .Cells(Rows.Count, 1).End(xlUp).Row + 1
                .Cells(iRow, 1).Value = Me.txtDate.Value
                .Cells(iRow, 2).Value = i
                .Cells(iRow, 4).Value = Me("TextBox" & i).Value
            Next i
    And in column B it displays "1" in b2, "2" in b3, "3" in b4, etc all the way to "18" in b19...
    I guess that makes sense...
    but what I want is to say: "51" in b2, "52" in b3, "53" in b4, all the way to "67" in b18, but in b19, I want it to say "73",

    so I change the code to say:
     For i = 51 To 68           
     iRow = .Cells(Rows.Count, 1).End(xlUp).Row + 1
                .Cells(iRow, 1).Value = Me.txtDate.Value
                .Cells(iRow, 2).Value = i
                .Cells(iRow, 4).Value = Me("TextBox" & i).Value
            Next i
    OK, I know I know, I did not address the "73" in b19, but I just wanted to tackle the 51 - 67 issue first, well when I change the code, it says "Object not found"...
    what am I doing wrong???

    Attached a workbook, you are looking at the "Order Log", sample of desired results highlighted in yellow
    Attached Files Attached Files
    Last edited by 00Able; 01-23-2011 at 08:49 PM.
    Providing Problems for Your Solutions
    STARS are my Punching Bag, You will be rewarded.

    In the rare event that I may help you, feel free to make me see STARS

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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