Select 2 rows up & X Column

*shudder*

Well-known Member
Joined
Aug 20, 2009
Messages
510
Office Version
  1. 2016
Platform
  1. Windows
I have a select change routine which currently works fine.

I wish to extend it so as I can take the value of the cell 2 rows up in column F and pass it into another macro so I can add the text to an Outlook task (I already have the code for this).

This is my select change routine:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)

'Do nothing if more than one cell is changed or content deleted
If Target.Cells.Count > 1 Then Exit Sub

ActiveSheet.Unprotect
If Not Intersect(Target, Range("F10:F100")) Is Nothing Then
    With ActiveCell.Offset(-2).EntireRow
        .AutoFit
        .RowHeight = .RowHeight + 12.75
        'Additional code here
    End With
End If
ActiveSheet.Protect
Thanks in advance
 
Last edited:

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Try adding this in

Dim Str As String
Str = ActiveCell.Row
Range("F" & Str).Select
Activecell.Offset(-2,0).Select
 
Upvote 0
I think I may have missed your point. Try this

Dim Str As String
Str = ActiveCell.Row
Range("F" & Str).Select
ActiveCell.Offset(-2, 0).Select
CellValue = ActiveCell.Value
Call NewMacro(CellValue)


Sub NewMacro(Strvalue As String)
Range("A2").Value = Strvalue
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,564
Messages
6,179,547
Members
452,925
Latest member
duyvmex

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top