Inserting Data at a Specific Point

joeyjj

Board Regular
Joined
Aug 12, 2010
Messages
62
Hello all,

I am trying to make a macro that will calculate information and then display the information in two locations. I have worked everything out But the following:

PHP:
'Report First Row
If Rws.Range("B20").Value <> "" Then
    RRow = Rws.Range("B20").End(xlDown).Row + 1
Else
    RRow = Rws.Range("B" & Rows.Count).End(xlUp).Row + 1
End If

This code should Find the first blank row Starting from B20. Please note that there is text below at B24 and text above at B14. I would like to have it start searching from B20 and look downwards as opposed to upwards from the beginning of the report.
 

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.
Make something like this?
Code:
Sub MyFindRow()

'   Find first blank cell in column B starting at row 20
    Dim RRow As Long
    
    If Range("B20").Value = "" Then
        RRow = 20
    Else
        If Range("B21").Value = "" Then
            RRow = 21
        Else
            RRow = Range("B20").End(xlDown).Row + 1
        End If
    End If
    
    MsgBox "First Blank Row is " & RRow
    
End Sub
 
Upvote 0
This worked great thank you. Now I have a new concern. The coding for my report is to take this paste the data calculated into a new (inserted) cell. I guess my main issue is if I am adding New cells into the worksheet The cells that I want to search for will not be at the same location. Is there a way to search for a specific type of wording say "Silencer Requirements" and have it find that wording and start searching 3 rows down?
 
Upvote 0
Is there a way to search for a specific type of wording say "Silencer Requirements" and have it find that wording and start searching 3 rows down?
Sure. If you use the Macro Recorder while using the "Find" functionality in Excel and search for your phrase, you will record the "Find" VBA code that you need. Then you can move three rows down from there using:
ActiveCell.Offset(3,0)<!-- / message -->
 
Upvote 0

Forum statistics

Threads
1,224,527
Messages
6,179,337
Members
452,907
Latest member
Roland Deschain

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