Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi there, I have managed this before, and subsequently lost the file I was working on. Being a total amateur in VBA I'm hoping that someone will be able to nudge me in the right direction!: I need to create a range of rows (columns are not required - just entire rows) an example logic is: In Column A, find "Very Likely Projects" - this is the first row in the range In Column A, find "Very Likely Projects Total" - this is the last row in the range. Select the range. simple, yes - can I remember hw to do it? no! any help will be gratefully recieved. thanks in advance -- matpj ------------------------------------------------------------------------ matpj's Profile: http://www.excelforum.com/member.php...o&userid=21076 View this thread: http://www.excelforum.com/showthread...hreadid=487981 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here is some code
Const sFind As String = "Very Likely Projects" Dim rngStart As Range Dim rngEnd As Range Dim rngAll As Range Set rngStart = Columns(1).Find(sFind) If Not rngStart Is Nothing Then Set rngEnd = Columns(1).Find(sFind & " Total") If Not rngEnd Is Nothing Then Set rngAll = Range(rngStart, rngEnd).EntireRow MsgBox rngAll.Address End If End If -- HTH RP (remove nothere from the email address if mailing direct) "matpj" wrote in message ... Hi there, I have managed this before, and subsequently lost the file I was working on. Being a total amateur in VBA I'm hoping that someone will be able to nudge me in the right direction!: I need to create a range of rows (columns are not required - just entire rows) an example logic is: In Column A, find "Very Likely Projects" - this is the first row in the range In Column A, find "Very Likely Projects Total" - this is the last row in the range. Select the range. simple, yes - can I remember hw to do it? no! any help will be gratefully recieved. thanks in advance -- matpj ------------------------------------------------------------------------ matpj's Profile: http://www.excelforum.com/member.php...o&userid=21076 View this thread: http://www.excelforum.com/showthread...hreadid=487981 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() thanks bob, that certainly identifies the range and displays it in a box. I need excel to actually select the rows, as I then need to perform a cut and then insert in a seperately identified row do you know how to do this? -- matpj ------------------------------------------------------------------------ matpj's Profile: http://www.excelforum.com/member.php...o&userid=21076 View this thread: http://www.excelforum.com/showthread...hreadid=487981 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Change
MsgBox rngAll.Address to rngAll.Select -- HTH RP (remove nothere from the email address if mailing direct) "matpj" wrote in message ... thanks bob, that certainly identifies the range and displays it in a box. I need excel to actually select the rows, as I then need to perform a cut and then insert in a seperately identified row do you know how to do this? -- matpj ------------------------------------------------------------------------ matpj's Profile: http://www.excelforum.com/member.php...o&userid=21076 View this thread: http://www.excelforum.com/showthread...hreadid=487981 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Copy rows based on cell content | Excel Discussion (Misc queries) | |||
Highting rows based on content of cells | Excel Worksheet Functions | |||
Delete Rows Based On Content | Excel Programming | |||
Delete Rows Based On Content | Excel Programming | |||
Hiding rows based on cell content | Excel Programming |