Posts by taylorpa5

    Happy Holidays All:


    Trying to paste some text box values from a form onto a spreadsheet but only where a pasted range of values has been placed.


    Scenario:


    1. User clicks a command button to start Entry.
    2. The form pops up with pre-populated text box values.
    3. User enters comments in an empty text box
    4. User clicks submit button to record the transaction.


    At step 4 from this point the form will copy the values that were pre-selected before the form was initialized and paste them into a designated worksheet called "ACTIVITYLOG" (which it is doing)
    THEN it should paste all the text box values from the form into the columns adjacent to the pasted values which I can't get it to do. This needs to happen for each transaction without overwriting the previous transactions.


    The code resides within the form as follows:
    [VBA]
    Sub MoveToLog()

    Application.ScreenUpdating = False

    'STEP 1: Copy and paste filtered range of cells from other worksheet to Activity Log worksheet...THIS PART WORKS FINE.


    With Sheets("ENTERPRISE")
    Range("ENTERPRISE[ID],ENTERPRISE[Risk Score],ENTERPRISE[Due Date],ENTERPRISE[Due In Days]").Copy '<----- Add ranges as required
    Sheets("ACTIVITYLOG").Cells(Rows.Count, 1).End(xlUp).Offset(1).PasteSpecial Paste:=xlValues
    End With
    '-------------------------------------------------------------------------------
    'STEP 2: Copy textbox values from form into empty cells adjacent to pasted range from above (starting in column E then column D, etc) HERE'S MY STICKING POINT.


    With Sheets("ACTIVITYLOG")
    Do
    If IsEmpty(ActiveCell) = False Then
    .Range("A2").End(xlDown).Offset(0, 4).Value = TextBox1.Value '<---goes to first empty cell in column E next to first pasted row of data and should copy down to last pasted row of data
    .Range("A2").End(xlDown).Offset(0, 6).Value = TextBox2.Value '<---goes to first empty cell in column F next to first pasted row of data and should copy down to last pasted row of data
    .Range("A2").End(xlDown).Offset(0, 7).Value = TextBox3.Value '<---goes to first empty cell in column G next to first pasted row of data and should copy down to last pasted row of data
    .Range("A2").End(xlDown).Offset(0, 8).Value = TextBox4.Value '<---goes to first empty cell in column H next to first pasted row of data and should copy down to last pasted row of data
    .Range("A2").End(xlDown).Offset(0, 9).Value = TextBox5.Value '<---goes to first empty cell in column I next to first pasted row of data and should copy down to last pasted row of data
    End If
    Loop Until IsEmpty(ActiveCell) = True
    End With

    Application.ScreenUpdating = True

    End Sub


    [/VBA]


    Any insights would be helpful!


    Thank you

    Hello World!


    Here's what I have...


    I need to do a vlookup in a column (TABLE1) but only extract the left most portion of the string based on a LEN count from another table (TABLE2), i.e below:


    TABLE1
    [TABLE="width: 555"]
    [/TABLE]
    [TABLE="width: 556"]

    [tr]


    [TD="class: xl65, width: 278"]Operating System[/TD]
    [TD="class: xl65, width: 278"]OS Checks[/TD]

    [/tr]


    [tr]


    [TD="class: xl66"]Solaris 5.8 2/02 SPARC[/TD]
    [TD="class: xl66"] [/TD]

    [/tr]


    [tr]


    [TD="class: xl68"]VMware ESXi 4.0.0 build 1682696[/TD]
    [TD="class: xl68"]
    [/TD]

    [/tr]


    [/TABLE]



    TABLE2
    [TABLE="width: 556"]

    [tr]


    [TD="width: 278"]PARTIAL OS[/TD]
    [TD="width: 278"]CHAR COUNT[/TD]

    [/tr]


    [tr]


    [td]

    Solaris 5.8

    [/td]


    [TD="align: right"]11[/TD]

    [/tr]


    [tr]


    [td]

    VMware ESXi 4.0.0

    [/td]


    [TD="align: right"]18[/TD]

    [/tr]


    [/TABLE]


    The field name "OS Checks" above is where the formula will be written. In TABLE2 the "CHAR COUNT" provides the count of the portion of text that I need pulled out of the "Operating System" field in TABLE1. I'll be writing logic against the results of the formula but need to get past this hump first!


    I'm open to better ways to achieve this of course!


    Please and Thank you.


    Buhwheet

    Hello World:


    Can't seem to see where or why my "Call" function for another subroutine isn't executing. The subroutine consists of a Select Case Statement that will place names in a column. The code is supposed to work as such:


    1. Execute primary Subroutine. We'll call this sub "A"
    2. Halfway through sub A, the Select Case Subroutine is being called to run. We'll call this sub "B"
    3. Once sub "B" runs, the remainder of sub "A" finishes its lines of code.


    Please note: The routine works fine when the code module is executed in the workbook that its executing in. However, when I place the module in my personal macro workbook, only the Sub "A" executes and completely ignores sub "B".


    It appears that everything is where it should be. Maybe a fresh pair of eyes can assist?


    Re: Loop or For Each in a Select Case Statement


    I solved it. I completely forgot that I have the code stored in a module under my personal macro workbook. The code works fine when I reference the workbook and sheet number for it to execute under!


    Thank you again!

    Re: Loop or For Each in a Select Case Statement


    Bryce, thank you for taking the time to assist. The code runs but with no results. As I debug through each line I'm seeing that the code is bypassing the Case Clauses within the Select Case block (jumping from the "For x = 2....." and not touching anything in between....then jumps to "End Sub". I tried to moving around a few lines of code like the "For X =2...." with no success. Everything else appears to be referencing correctly.


    Hello World:


    Need advice or an example of how to loop through a range of cells to execute the below Select Case Statement for Each occuring case.


    Example: If the value of "Windows 7 Enterprise 64 bit Edition Service Pack 1" occurs in any of the cells in Range R2, then each cell in the correspondeing cell location in Range AV2 should enter a value that reads "End User Support" and then so on for each successive Case. Let me know if I'm not clear on this please!



    Please and Thank you

    Re: Excel Formula in VBA Code


    Didn't help. Same error code 104. Changed the code to read as:


    Code
    'Set Priority Level
            .Range("AI2:AI" & lastRow).Formula = _
            "=IF(AND(OR(Scan_Type=""External""),AND(Exploitability<>""Unproven"",Exploitability<>"""")),1," & _
            "IF(AND(OR(Scan_Type=""Internal"",Scan_Type=""DMZ""),AND(Exploitability<>""Unproven"",Exploitability<>"""")),2," & _
            "IF(AND(OR(Scan_Type=""External""),AND(Exploitability=""Unproven"")),3," & _
            "IF(AND(OR(Scan_Type=""Internal"",Scan_Type=""DMZ""),AND(Exploitability=""Unproven"")),4,""??""))))"


    Baffled....

    Hello World,



    Trying to get the formula below (where it says PROBLEM AREA below) to calculate but keep getting the "Application defined or Object Defined" error message and can't seem to solve it. What am I missing here?


    Hello World,


    I'm faced with trying to reference a column named range in my VBA code. The range was defined in the Name Manager via VBA code first which assigned a label name for each column header too. In the below code (between the ****** lines below) I'm trying to switch from column and row references (R1C1) to the named column range in my formula in order to keep the formula in tact in the event additional columns are added to my data set.


    See below:



    Any guidance is appreciated!

    Re: Worksheet Loop


    I friggen love this forum. My code actually works pretty fast (not a lot of worksheets), but I do appreciate the quick lesson. I'll give this a shot tomorrow.

    Re: Worksheet Loop


    Fixed it. Thank you for anyone who took the time to review my post. Needed to activate each sheet on the loop.
    The new code is:


    Can't figure out how to get the worksheet loop to advance to the next sheet. The way code is written currently loops the procedure on the same worksheet. What am I missing here?


    Re: Loop Userform and record label captions and text box entries


    Grimes, thanks for the feedback, however incrementing the control index at +7 (which is now corrected from +9 as stated in the previous code) will add 7 to 12 putting my next labels control number at 19 for the next loop. Control 19 is the first label caption on the next row to loop through. Here's the revised code incrementing the controlindex +7 for the next loop:



    Everything goes well until I get to the 2nd textbox. When the sub procedure is ran to record the line items where only the first textbox has a value, the values returned to the worksheet looks like this (as it should):
    [TABLE="width: 2130"]

    [tr]


    [td]


    [TABLE="width: 2295"]

    [tr]


    [td]

    Project ID

    [/td]


    [td]

    Order No.

    [/td]


    [td]

    Item No.

    [/td]


    [td]

    Subs

    [/td]


    [td]

    Line No.

    [/td]


    [td]

    Description

    [/td]


    [td]

    Qty

    [/td]


    [td]

    Item Status

    [/td]


    [td]

    Submitted By

    [/td]


    [td]

    Date Submitted

    [/td]


    [td]

    Re-Order Qty

    [/td]


    [/tr]


    [tr]


    [td]

    CLV1424 - MRLOS023917 - LTE 2C-NSB-CX

    [/td]


    [td]

    801214101

    [/td]


    [td]

    CEQ.13922

    [/td]


    [td]

    No Subs

    [/td]


    [td]

    1.1

    [/td]


    [td]

    Ericsson,RPM2530292/5000,,,,CPRI cascade cable for RRUS,02/11/12,5m,,

    [/td]


    [td]

    3

    [/td]


    [td]

    Awaiting Shipping

    [/td]


    [td]

    tay70662

    [/td]


    [td]

    Wednesday, Feb, 10, 2016

    [/td]


    [td]

    1

    [/td]


    [/tr]


    [tr]


    [td]

    CLV1424 - MRLOS023917 - LTE 2C-NSB-CX

    [/td]


    [td]

    801214101

    [/td]


    [td]

    CEQ.13681

    [/td]


    [td]

    No Subs

    [/td]


    [td]

    2.1

    [/td]


    [td]

    Ericsson,UCRRUS12B2-48,,,,RRUS12 B2 1900; 5MHz BW,,2x60W,-48V,,

    [/td]


    [td]

    3

    [/td]


    [td]

    Awaiting Shipping

    [/td]


    [td]

    tay70662

    [/td]


    [td]

    Wednesday, Feb, 10, 2016

    [/td]


    [td]

    1

    [/td]


    [/tr]


    [tr]


    [td]

    CLV1424 - MRLOS023917 - LTE 2C-NSB-CX

    [/td]


    [td]

    801214101

    [/td]


    [td]

    CEQ.13677

    [/td]


    [td]

    No Subs

    [/td]


    [td]

    3.1

    [/td]


    [td]

    Ericsson,UCRRUSA2B2-48,,,,RRUS A2 B2 1900; 5MHz BW, ,-48V,,,

    [/td]


    [td]

    3

    [/td]


    [td]

    Awaiting Shipping

    [/td]


    [td]

    tay70662

    [/td]


    [td]

    Wednesday, Feb, 10, 2016

    [/td]


    [td]

    1

    [/td]


    [/tr]


    [tr]


    [td]

    CLV1424 - MRLOS023917 - LTE 2C-NSB-CX

    [/td]


    [td]

    801214101

    [/td]


    [td]

    CEQ.13853

    [/td]


    [td]

    No Subs

    [/td]


    [td]

    4.1

    [/td]


    [td]

    Ericsson,RPM5132350/15000,,,,Signal cable RRUS12 external,alarm,,,

    [/td]


    [td]

    3

    [/td]


    [td]

    Awaiting Shipping

    [/td]


    [td]

    tay70662

    [/td]


    [td]

    Wednesday, Feb, 10, 2016

    [/td]


    [td]

    1

    [/td]


    [/tr]


    [/TABLE]

    If I place an entry in the second textbox, it goes haywire:


    [TABLE="width: 2295"]

    [tr]


    [td]

    Project ID

    [/td]


    [td]

    Order No.

    [/td]


    [td]

    Item No.

    [/td]


    [td]

    Subs

    [/td]


    [td]

    Line No.

    [/td]


    [td]

    Description

    [/td]


    [td]

    Qty

    [/td]


    [td]

    Item Status

    [/td]


    [td]

    Submitted By

    [/td]


    [td]

    Date Submitted

    [/td]


    [td]

    Re-Order Qty

    [/td]


    [td]

    Order Comments

    [/td]


    [/tr]


    [tr]


    [td]

    CLV1424 - MRLOS023917 - LTE 2C-NSB-CX

    [/td]


    [td]

    801214101

    [/td]


    [td]

    CEQ.13922

    [/td]


    [td]

    No Subs

    [/td]


    [td]

    1.1

    [/td]


    [td]

    Ericsson,RPM2530292/5000,,,,CPRI cascade cable for RRUS,02/11/12,5m,,

    [/td]


    [td]

    3

    [/td]


    [td]

    Awaiting Shipping

    [/td]


    [td]

    tay70662

    [/td]


    [td]

    Wednesday, Feb, 10, 2016

    [/td]


    [td]

    1

    [/td]


    [td]

    1

    [/td]


    [/tr]


    [tr]


    [td]

    CLV1424 - MRLOS023917 - LTE 2C-NSB-CX

    [/td]


    [td]

    801214101

    [/td]


    [td]

    CEQ.13681

    [/td]


    [td]

    No Subs

    [/td]


    [td]

    2.1

    [/td]


    [td]

    Ericsson,UCRRUS12B2-48,,,,RRUS12 B2 1900; 5MHz BW,,2x60W,-48V,,

    [/td]


    [td]

    3

    [/td]


    [td]

    Awaiting Shipping

    [/td]


    [td]

    tay70662

    [/td]


    [td]

    Wednesday, Feb, 10, 2016

    [/td]


    [td]

    test1

    [/td]


    [td]

    test1

    [/td]


    [/tr]


    [tr]


    [td]

    CLV1424 - MRLOS023917 - LTE 2C-NSB-CX

    [/td]


    [td]

    801214101

    [/td]


    [td]

    CEQ.13677

    [/td]


    [td]

    No Subs

    [/td]


    [td]

    3.1

    [/td]


    [td]

    Ericsson,UCRRUSA2B2-48,,,,RRUS A2 B2 1900; 5MHz BW, ,-48V,,,

    [/td]


    [td]

    3

    [/td]


    [td]

    Awaiting Shipping

    [/td]


    [td]

    tay70662

    [/td]


    [td]

    Wednesday, Feb, 10, 2016

    [/td]


    [td]

    2

    [/td]


    [td]

    2

    [/td]


    [/tr]


    [tr]


    [td]

    CLV1424 - MRLOS023917 - LTE 2C-NSB-CX

    [/td]


    [td]

    801214101

    [/td]


    [td]

    CEQ.13853

    [/td]


    [td]

    No Subs

    [/td]


    [td]

    4.1

    [/td]


    [td]

    Ericsson,RPM5132350/15000,,,,Signal cable RRUS12 external,alarm,,,

    [/td]


    [td]

    3

    [/td]


    [td]

    Awaiting Shipping

    [/td]


    [td]

    tay70662

    [/td]


    [td]

    Wednesday, Feb, 10, 2016

    [/td]


    [td]

    test 2

    [/td]


    [td]

    test 2

    [/td]


    [/tr]


    [tr]


    [td]

    CLV1424 - MRLOS023917 - LTE 2C-NSB-CX

    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]

    tay70662

    [/td]


    [td]

    Wednesday, Feb, 10, 2016

    [/td]


    [td]

    3

    [/td]


    [td]

    3

    [/td]


    [/tr]


    [tr]


    [td]

    CLV1424 - MRLOS023917 - LTE 2C-NSB-CX

    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]

    tay70662

    [/td]


    [td]

    Wednesday, Feb, 10, 2016

    [/td]


    [td]

    test 3

    [/td]


    [td]

    test 3

    [/td]


    [/tr]


    [tr]


    [td]

    CLV1424 - MRLOS023917 - LTE 2C-NSB-CX

    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]

    tay70662

    [/td]


    [td]

    Wednesday, Feb, 10, 2016

    [/td]


    [td]

    4

    [/td]


    [td]

    4

    [/td]


    [/tr]


    [tr]


    [td]

    CLV1424 - MRLOS023917 - LTE 2C-NSB-CX

    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]

    tay70662

    [/td]


    [td]

    Wednesday, Feb, 10, 2016

    [/td]


    [td]

    test 4

    [/td]


    [td]

    test 4

    [/td]


    [/tr]


    [/TABLE]

    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [/tr]


    [tr]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [td]


    [/td]


    [/tr]


    [tr]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [td]

    This is a lot for a free forum. I'll understand if this goes unanswered.


    I've tried everything i know of to make this work with no success. Feel free to reply to point out where I'm not thinking correctly.


    Thanks for the support.

    [/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [tr]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [td][/td]


    [/tr]


    [/TABLE]