VBA extract column/ row value from address string

Hile_Troy

New Member
Joined
Sep 27, 2011
Messages
15
Hi Folks

I am trying to work out how to get column/ row values from an address string. the relevant code I am using is:-

DivCell = Cells(DivRow, DivCol).Address
EndCell = Cells(ExpRow, ColMax).Address
If Not Intersect(Target, Range(DivCell, EndCell)) Is Nothing Then
Target.Address... 'This is where the problems start
End If

The code works fine, I can display the address in a message box and all is good, what I want to do is to insert a value into a cell that is in the same column but a different row than Target.

I cannot use a fixed offset as that would not work for my project.

Can anyone help? Please.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Right, the whole picture. I am working with a spreadsheet that shows training modules and associated details down the left (600+ rows), and role details along the top(150+ columns). In the middle is a matrix relating a specific role with a specific training module. As such, with all of the details (headcount, division, business area, team name, role name etc) of a particular role all being contained in the same column, and the spreadsheet changing on an almost daily basis I want to automate as much as possible, the spreadsheet gets updated to a database regularly and the amend tag tells the vba that updates the database to alter that record.

Hope all that makes sense
 
Upvote 0
I would like, when any of the role details are changed (Division in row1, business area in row2, team name in row3 etc) I want the word amend to autopopulate in row 7 in the same column as the change.

(when I work that out I can adapt it to fit the modules down the side)
 
Upvote 0
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row < 7 Then
Cells(7, Target.Column) = "Amend"
End If

End Sub
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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