Results 1 to 1 of 1

VBA/Excel temporarily hold/record/copy a range value then write that value into a cell

Threaded View

SKooLZ VBA/Excel temporarily... 05-21-2015, 05:50 PM
  1. #1
    Registered User
    Join Date
    04-14-2015
    Location
    London
    MS-Off Ver
    2007
    Posts
    36

    VBA/Excel temporarily hold/record/copy a range value then write that value into a cell

    Hi fellow excel heads... I've yet another of my many stumbling blocks with my novice coding abilities where I have to real in the experts.

    my example spreadsheet is designed to refresh the filters every time I change a status in in column F of sheet 1 or any sheet for that matter.
    What I want it to do and failing to achieve is for it, if status 'Chain' is selected, it should copy the ref no. in column A of the same line and, insert a new line by calling a macro I have designed for inserting a new newline and then place the copied ref no. into the A column of the new line. The new and old must have the same ref. no. My code is doing everything else other than copying and pasting the ref. no.

    my code is here
    ub status_refresh()
    
           Dim newVal As String
    
        If ActiveCell.Count > 1 Then Exit Sub
        If ActiveCell.Column = 6 Then
           
        'If Target.Column <> 100 Then
            newVal = ActiveCell.Value
            If newVal <> "" Then
               If newVal = "Chain" Then GoTo 400
               
                Application.ScreenUpdating = False
                
                'refreshes the filter to rearrange statuses
                Call Refreshfilter
                
                'make sure this row is always hidden. Ihide it because I want to insert a line between 6 & 7 so that all the conditional formatting carries over into new line.
                Rows("6:6").Select
                Selection.EntireRow.Hidden = True
                
                ActiveSheet.Range("F7").Select
                
                Else
                
                End If
    
        
            End If
          Exit Sub
    
    400:
    
                Set Refno = ActiveCell.Range("A" & ActiveCell.Row)
                Call insertnewline
                ActiveSheet.Range("A7").Value = Refno
                Call Refreshfilter
                
    End Sub
    Many thanks in advance.
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Hold cell range when copying down
    By mikeuk1954 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-26-2015, 10:33 AM
  2. RE:- Write Macro to copy a 2 cell range to another 2 cell range down the columns
    By Eire001 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-02-2013, 11:48 PM
  3. [SOLVED] Macro to temporarily unprotect sheet to apply filter to locked cell range, then reprotect?
    By lsargent in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-28-2013, 10:27 AM
  4. Allow a Range of Cells to hold same decimal formatting as one specified cell
    By SoteriaLive in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-01-2012, 02:47 PM
  5. [SOLVED] Excel: hold a reference to a single cell when copying formulas?
    By Jim in Texas in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 05-18-2005, 01:06 PM

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