User Profile

Collapse

Profile Sidebar

Collapse
philqw78
philqw78
Last Activity: Apr 23 '12, 07:33 AM
Joined: Jun 18 '10
Location: UK
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • philqw78
    replied to How do I get this Loop to stop
    Sorry again. Figured it out. I am not having to escape the loop. The code keeps going round because the worksheet change events are fired.

    Code:
    Application.EnableEvents=False
    'then later 
    ....True
    cures it
    See more | Go to post

    Leave a comment:


  • philqw78
    started a topic How do I get this Loop to stop

    How do I get this Loop to stop

    I have written this to clear cells coloured 56 in the target row from columns A to L when a Message box is OK'd. But how do I stop it from carrying on and on?
    Code:
    Dim Rw As String
    Rw = Target.Row
    Dim Ar As String
    Ar = "A" & Rw & ":" & "L" & Rw
    Dim Rg As Range
    Set Rg = Range(Ar)
    
    For Each cl In Rg
    
            With cl
                If
    ...
    See more | Go to post

  • Please don't answer this thread

    Sorry guys, I worked this out. Posted to soon due to frustration.

    I needed to monitor the target cell on the double click before this and use the monitored cell to get back in the Keydown.

    Code:
    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    monitored2 = ActiveCell.Address
    ..... 'rest of code to call combo
    then
    ...
    See more | Go to post

    Leave a comment:


  • Return to Previous Value When Using Combo Box in Excel

    I have a combo box with a pick list in excel.
    The combo box fires on double click of a cell with validation
    If the user then presses the escape key I wnat the linked cell to return to the previous value.

    So far I have got the double click to copy the original value into cell "A1"

    Then I have the following code on keystroke for the combo
    Code:
    Private Sub PickCombo_KeyDown(ByVal _
            KeyCode
    ...
    See more | Go to post
    Last edited by NeoPa; Apr 4 '12, 01:03 PM. Reason: Merged posts.

  • There are 42 different types of record and hence 42 different ways of getting "Y" for record complete. Getting the "Y" in column C takes calculations in 8 other columns ensuring that all the correct fields have been completed. I suppose I could have nested them in 2 or three cells, but that would have been really confusing if anything needed to change. Getting that done in VB is well beyond me. Clumsy but workable will have...
    See more | Go to post

    Leave a comment:


  • Rows 1 to 197 are hidden, they have autocomplete lists above the data. Rows 197 to 200 are Titles. All data is row 201 onwards. The users have an action button to insert new rows at the end.
    The workbook is VERY locked down. Each row starts with 1 cell that the users enter data into, depending what they enter other cells unlock in that row until they have entered all the necessary data.
    As for understanding my logic I have problems...
    See more | Go to post

    Leave a comment:


  • Figured it out thanks guys. I just had to think a bit harder and you pushed me in the right direction. This is what I ended up doing.

    I made a formula on the sheet that was the sum of column C, counting a "Y" as 1. If that value increased, soomething must have changed to "Y" so:
    Code:
    Option Explicit
     'Monitor C198 sum of completed records
    Dim Monitored
    
    Private Sub Worksheet_Activate()
    ...
    See more | Go to post

    Leave a comment:


  • Guys, these only work if I go into the cell and change the value manually. But the cell is a result of a calculation that changes to "Y" when the correct cells have been filled. (Cells needing completion and info needed depend upon type of record.)
    So I need to monitor the cell and get a pop up message when the result of the calcualtion changes.
    This is the original code I put in
    Code:
    Private Sub Worksheet_Calculate()
    ...
    See more | Go to post

    Leave a comment:


  • The code is at work. I will post it Monday.
    See more | Go to post

    Leave a comment:


  • Sorry, I have put the code in worksheet on calculate.
    See more | Go to post

    Leave a comment:


  • Excel: Trigger Event when Cell Value Changes due to Calculation

    I have a spreadsheet (Excel 2003*)

    Column C changes to "Y" when all the necessary data has been input in that row. I want a message box to appear when the value in column C changes to Y for the active row.

    I am using this code but it fires every time any cell chnges.
    Code:
    Dim rngC As Range
    Set rngC = Intersect(Range("C201:C64000"), Target)
    If rngC.Value = "Y" Then
    ...
    See more | Go to post

  • I have so far managed
    Code:
    Sub CopyALL()
    ActiveSheet.Range("A1").CurrentRegion.Offset(1).Resize(Range("A1").CurrentRegion.Rows.Count - 1).Copy _
     Destination:=Workbooks("copybook.xlsm").Sheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
    ActiveWorkbook.Close False
    
    End Sub
    Now I just need to get it to loop through this in your code Guido, if its possible. At the...
    See more | Go to post
    Last edited by philqw78; Mar 22 '11, 03:37 PM. Reason: More Info

    Leave a comment:


  • Thanks a lot Guido. I figured out the Tools and References but could not get the Private sub to run without your User Form. Works a treat in 2007.

    Now for my next question, can VB copy all the first sheets in those books opened to a single sheet in a new workbook?

    I'll start working on it but you will probably beat me to the answer.

    Thanks again
    See more | Go to post

    Leave a comment:


  • Guido, a couple of problems. VB is not one of my strengths and I have little understanding of it.
    What do I have to do for this

    Also this is "Private Sub " so it does not show on my list of available macros. I can change it to "Sub" then it does appear but I then get the error
    Code:
    Compile error
    
    User defined type not defined
    and this code is highlighted on the debug
    Code:
    Dim
    ...
    See more | Go to post
    Last edited by philqw78; Mar 21 '11, 01:37 PM. Reason: Added info

    Leave a comment:


  • Because it would be faster to open them individually. I want to open 65 files quickly and copy them all to the same sheet....
    See more | Go to post

    Leave a comment:


  • How can I open all excel files in a folder and its sub folders

    I get sent a folder containing zip files. I extract the zips to another folder. This then gives me 65 sub folders(directo ries), each with an excel and a text file. I wish to open all the excel files with one action in VB. If possible put them all on a single sheet in one workbook. They are all formatted the same and do not contain a lot of data so size and formatting will not be a problem.
    I have
    Code:
    Sub Open_My_Files()
    Dim
    ...
    See more | Go to post

  • philqw78
    started a topic How best to make a Record of Changes

    How best to make a Record of Changes

    I have a table of data for which every change to the data in the table must be recorded. What is the best way to do this with minimum work, and therefore mistakes, from the end user?
    I was thinking make a table with the following
    • Record ID
      Field Affected
      Old Field Value
      New Field value
      Change Implementer
      Date Changed

    I will then use a form to fill the table. Its just getting the form to pull the old...
    See more | Go to post

  • Thanks Neo. Worked great. Then realised that they will find a better fool if you make something foolproof. Have solved the problem with validation.
    Code:
    ALike "[a-z]R[123456789]" Or ALike "[a-z]R[123456789][1234567890]" Or ALike "[a-z]R[123456789][1234567890][1234567890]" Or ALike "[a-z]R[123456789][1234567890][1234567890][1234567890]" Or ALike "[a-z]R[123456789][1234567890][1234567890][1234567890][1234567890]"
    ...
    See more | Go to post

    Leave a comment:


  • Using iif(iserror( or iif(isnumeric( in Access table Order By

    I am trying to sort a list of alphanumeric ID's in numeric order using the OrderBy property of a table. They are in the format of 2 letters followed by numbers. Like this "AA10199"
    However the number is not an autonumber part, it is entered by users. Sometimes these users put too many letters in, like this "AAa10199" so my original sort for the table fails.
    This was
    Code:
     cint(mid([ar_id],3,8))
    Sorted ascending....
    See more | Go to post

  • Thanks Jim, but I can ping the file server no problem and no packets are lost.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...