Results 1 to 10 of 10

Macro problem for absolute reference

Threaded View

ronlau123 Macro problem for absolute... 06-16-2011, 12:07 PM
realniceguy5000 Re: Macro problem for... 06-16-2011, 02:29 PM
ronlau123 Re: Macro problem for... 06-16-2011, 04:35 PM
realniceguy5000 Re: Macro problem for... 06-17-2011, 10:31 AM
ronlau123 Re: Macro problem for... 06-19-2011, 02:27 AM
ronlau123 Re: Macro problem for... 06-21-2011, 01:29 AM
ronlau123 Re: Macro problem for... 07-15-2011, 12:29 AM
watersev Re: Macro problem for... 07-15-2011, 03:23 AM
ronlau123 (solved) Re: Macro problem... 07-15-2011, 11:59 PM
watersev Re: Macro problem for... 07-16-2011, 07:47 AM
  1. #1
    Forum Contributor
    Join Date
    04-29-2011
    Location
    South Korea
    MS-Off Ver
    Excel 2019
    Posts
    178

    Macro problem for absolute reference

    Dear big brother and sister,

    I have a tricky task. I hope you can give me reply. appreciate your help.

    I have the following macro. However, sometimes, it doesn't work, it may be because it doesn't applied on specific sheet. May I ask how can I modify the following macro to let it run on specific sheet only.

    Secondly, as you go to sheet "before macro", after I use macro for Sub Absolute() (all cells selected are absolute reference", it returns to VALUE. May I know why?

    Thanks




    
    Sub Absolute()
    Dim cell As Range
    For Each cell In Selection
    If cell.HasFormula Then
    cell.Formula = Application.ConvertFormula _
    (cell.Formula, xlA1, xlA1, xlAbsolute)
    End If
    Next
    End Sub
    
    Sub AbsoluteRow()
    Dim cell As Range
    For Each cell In Selection
    If cell.HasFormula Then
    cell.Formula = Application.ConvertFormula _
    (cell.Formula, xlA1, xlA1, xlAbsRowRelColumn)
    End If
    Next
    End Sub
    
    Sub AbsoluteCol()
    Dim cell As Range
    For Each cell In Selection
    If cell.HasFormula Then
    cell.Formula = Application.ConvertFormula _
    (cell.Formula, xlA1, xlA1, xlRelRowAbsColumn)
    End If
    Next
    End Sub
    
    Sub Relative()
    Dim cell As Range
    For Each cell In Selection
    If cell.HasFormula Then
    cell.Formula = Application.ConvertFormula _
    (cell.Formula, xlA1, xlA1, xlRelative)
    End If
    Next
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

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