Related:
- Excel if statement trouble
- Fenix internet on bank statement - Guide
- Excel if statement - Guide
- Excel marksheet - Guide
- An if statement nested within another if statement will produce how many possible results? - Guide
- Number to words in excel - Guide
1 response
venkat1926
Posts
1863
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
811
Dec 23, 2009 at 09:37 PM
Dec 23, 2009 at 09:37 PM
you have not given complete information
I assume except for column A all other columns are BLANK.
if this so the following macro will work. if not give complete information and the macro needs modification
(the profit center total for venue D is not there. If it is there even then the macro will work.
I assume except for column A all other columns are BLANK.
if this so the following macro will work. if not give complete information and the macro needs modification
(the profit center total for venue D is not there. If it is there even then the macro will work.
Sub test() Dim x As String, cfind As Range, venue As Range Dim add As String x = "Profit Center Total:" Worksheets("sheet1").Activate On Error Resume Next Set cfind = Columns("A:A").Cells.Find(what:=x, lookat:=xlWhole) If Not cfind Is Nothing Then add = cfind.Address Set venue = cfind.Offset(0, 1).End(xlUp).Offset(0, -1) 'msgbox venue cfind.Offset(0, 1) = venue End If Do Set cfind = Cells.FindNext(cfind) If cfind Is Nothing Then Exit Do If cfind.Address = add Then Exit Do Set venue = cfind.Offset(0, 1).End(xlUp).Offset(0, -1) Set venue = venue.Offset(1, 0) 'msgbox venue 'msgbox cfind.Address cfind.Offset(0, 1) = venue Loop End Sub
Dec 24, 2009 at 10:50 AM