+ Reply to Thread
Results 1 to 1 of 1

Follow on Phase 2 Need VBA Guru / Advice to Finish Sheet

  1. #1
    Registered User
    Join Date
    05-02-2005
    Posts
    56

    Follow on Phase 2 Need VBA Guru / Advice to Finish Sheet

    HI Guys

    Just finished a post re formulas now need some VBA help/advice.

    VBA Query
    Now for Phase 2 with all the formulas working I now need advice/help with columns X & Y
    My current situation is I only have column Y on my live sheet. I have some VBA done a few years ago by a helpful forum member. (embeded in the copy sheet attached)
    In essence and without boring you to death prices change daily so I needed a solution to fix the prices after a sale.
    As live data changes hourly I didn’t want my sales figures to keep changing.
    So when I select Y (Yes) in column Y it should fix the values in the following cells.
    H,J,K,Q and S this would lock down the sale
    VBA supplied**
    So I need to make sure the code is doing this.
    But I also need an option to have a refund which could be in column X OR added to the dropdown in column Y as Y = Fix Sale R=Refund
    The Refund needs to set columns H J F to £0.00 this should leave Profit showing £-0.20 as PayPal still charge the seller even after a refund.

    It would be better to build it into column Y and rename it Status.
    If this needs a new post please let me know I will recreate it in another forum topic.
    Also thank you for all your help so far as you can see I have done a lot myself but a few areas do not click with me still in Excel

    **Private Sub Worksheet_Change(ByVal Target As Range)


    'dont do anything if multi cells selected or cell is not column V or is not input as "Y"
    If Target.Cells.Count > 1 Then Exit Sub
    If Not Target.Column = 22 Then Exit Sub '22 = column V
    If Not UCase(Target) = "Y" Then Exit Sub


    'dont do anything if Profit shows an error ie info is incomplete
    If Evaluate("ISERROR(" & Target.Offset(0, -1).Address & ")") Then
    MsgBox "Line details are incomplete. Please check and try again!", vbOKOnly, "Sorry"
    Application.EnableEvents = False
    Target = ""
    Application.EnableEvents = True
    Exit Sub
    End If


    'Otherwise....
    If MsgBox("Please confirm that you wish to fix this entry.", vbYesNo, "Confirm Details?") = vbNo Then Exit Sub
    'if is the last row of table then add a dummy row to maintain the formulas
    r = Target.Row
    lr = Cells(Rows.Count, "A").End(xlUp).Row
    If r = lr Then Cells(lr + 1, "A") = "NEXT ITEM"
    'change the row's formula results to hard value
    Range("A" & r & ":S" & r).Value = Range("A" & r & ":S" & r).Value


    End Sub
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] help finish/fix this code: copy non-blank cells to corresponding cell on another sheet
    By Rerock in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2016, 01:38 PM
  2. How to get data to follow through to seperate sheet?
    By joelyoung94 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-23-2014, 06:03 AM
  3. How can i finish my sheet?
    By Adam Schaefer in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-17-2013, 06:07 PM
  4. Look up value in range, and follow hyperlink on another sheet
    By lozoroo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-29-2013, 08:52 AM
  5. [SOLVED] Efficiency advice. Finding record status on a sheet to update another sheet.
    By Opy in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-12-2012, 09:23 PM
  6. Determining project phase based on specified phase time point intervals
    By ElPorko in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2008, 09:46 AM
  7. How to force a macro to wait for a large sheet sort to finish
    By nicohlis in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-04-2005, 11:15 AM

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