ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   finding row 7 (https://www.excelbanter.com/excel-programming/348549-finding-row-7-a.html)

Antonov

finding row 7
 
Hello everybody,
I have this code, which works fine... but I need the application to start
looking for the first empty row starting from row 7... how can I do that?

Private Sub CommandButton1_Click()

Range("A7").Select

Do

If IsEmpty(ActiveCell) = False Then

ActiveCell.Offset(1, 0).Select

End If

Loop Until IsEmpty(ActiveCell) = True
Dim rng As Range
ActiveCell.EntireRow.FillDown
On Error Resume Next
Set rng = ActiveCell.EntireRow.SpecialCells(xlConstants)
On Error GoTo 0
If Not rng Is Nothing Then
rng.ClearContents
End If

Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("GiM")

iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row



Tom Ogilvy

finding row 7
 
Range("A7").Select

says it is doing that already.

--
Regards,
Tom Ogilvy


"antonov" wrote in message
.. .
Hello everybody,
I have this code, which works fine... but I need the application to start
looking for the first empty row starting from row 7... how can I do that?

Private Sub CommandButton1_Click()

Range("A7").Select

Do

If IsEmpty(ActiveCell) = False Then

ActiveCell.Offset(1, 0).Select

End If

Loop Until IsEmpty(ActiveCell) = True
Dim rng As Range
ActiveCell.EntireRow.FillDown
On Error Resume Next
Set rng = ActiveCell.EntireRow.SpecialCells(xlConstants)
On Error GoTo 0
If Not rng Is Nothing Then
rng.ClearContents
End If

Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("GiM")

iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row





Antonov

finding row 7
 
Hi Tom,
when I click on the command button the first code (you gave me) will copy
the formulas down to the next row... but the second part of the code will
input the data contained in the userform in row 3 (which is the first empty
row). But I need the data to be input starting from row 7
"Tom Ogilvy" wrote in message
...
Range("A7").Select


says it is doing that already.

--
Regards,
Tom Ogilvy


"antonov" wrote in message
.. .
Hello everybody,
I have this code, which works fine... but I need the application to start
looking for the first empty row starting from row 7... how can I do that?

Private Sub CommandButton1_Click()

Range("A7").Select

Do

If IsEmpty(ActiveCell) = False Then

ActiveCell.Offset(1, 0).Select

End If

Loop Until IsEmpty(ActiveCell) = True
Dim rng As Range
ActiveCell.EntireRow.FillDown
On Error Resume Next
Set rng = ActiveCell.EntireRow.SpecialCells(xlConstants)
On Error GoTo 0
If Not rng Is Nothing Then
rng.ClearContents
End If

Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("GiM")

iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row







Tom Ogilvy

finding row 7
 
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("GiM")

iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
If iRow < 7 then iRow = 7

--
Regards,
Tom Ogilvy


"antonov" wrote in message
...
Hi Tom,
when I click on the command button the first code (you gave me) will copy
the formulas down to the next row... but the second part of the code will
input the data contained in the userform in row 3 (which is the first

empty
row). But I need the data to be input starting from row 7
"Tom Ogilvy" wrote in message
...
Range("A7").Select


says it is doing that already.

--
Regards,
Tom Ogilvy


"antonov" wrote in message
.. .
Hello everybody,
I have this code, which works fine... but I need the application to

start
looking for the first empty row starting from row 7... how can I do

that?

Private Sub CommandButton1_Click()

Range("A7").Select

Do

If IsEmpty(ActiveCell) = False Then

ActiveCell.Offset(1, 0).Select

End If

Loop Until IsEmpty(ActiveCell) = True
Dim rng As Range
ActiveCell.EntireRow.FillDown
On Error Resume Next
Set rng = ActiveCell.EntireRow.SpecialCells(xlConstants)
On Error GoTo 0
If Not rng Is Nothing Then
rng.ClearContents
End If

Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("GiM")

iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row









Antonov

finding row 7
 
I am trying to use the whole formula but there is one problem:
some of the cells contain formulas and when I run the userform all the
formula disappear... is there a way around it?
"Tom Ogilvy" wrote in message
...
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("GiM")

iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
If iRow < 7 then iRow = 7

--
Regards,
Tom Ogilvy


"antonov" wrote in message
...
Hi Tom,
when I click on the command button the first code (you gave me) will copy
the formulas down to the next row... but the second part of the code will
input the data contained in the userform in row 3 (which is the first

empty
row). But I need the data to be input starting from row 7
"Tom Ogilvy" wrote in message
...
Range("A7").Select

says it is doing that already.

--
Regards,
Tom Ogilvy


"antonov" wrote in message
.. .
Hello everybody,
I have this code, which works fine... but I need the application to

start
looking for the first empty row starting from row 7... how can I do

that?

Private Sub CommandButton1_Click()

Range("A7").Select

Do

If IsEmpty(ActiveCell) = False Then

ActiveCell.Offset(1, 0).Select

End If

Loop Until IsEmpty(ActiveCell) = True
Dim rng As Range
ActiveCell.EntireRow.FillDown
On Error Resume Next
Set rng = ActiveCell.EntireRow.SpecialCells(xlConstants)
On Error GoTo 0
If Not rng Is Nothing Then
rng.ClearContents
End If

Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("GiM")

iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row











Tom Ogilvy

finding row 7
 
I would assume the solution would lie in adjusting your code to avoid doing
whatever it is doing.

Formulas don't disappear on there own, so identify the code that clears the
formulas and adjust it.

--
Regards,
Tom Ogilvy

"antonov" wrote in message
.. .
I am trying to use the whole formula but there is one problem:
some of the cells contain formulas and when I run the userform all the
formula disappear... is there a way around it?
"Tom Ogilvy" wrote in message
...
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("GiM")

iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
If iRow < 7 then iRow = 7

--
Regards,
Tom Ogilvy


"antonov" wrote in message
...
Hi Tom,
when I click on the command button the first code (you gave me) will

copy
the formulas down to the next row... but the second part of the code

will
input the data contained in the userform in row 3 (which is the first

empty
row). But I need the data to be input starting from row 7
"Tom Ogilvy" wrote in message
...
Range("A7").Select

says it is doing that already.

--
Regards,
Tom Ogilvy


"antonov" wrote in message
.. .
Hello everybody,
I have this code, which works fine... but I need the application to

start
looking for the first empty row starting from row 7... how can I do

that?

Private Sub CommandButton1_Click()

Range("A7").Select

Do

If IsEmpty(ActiveCell) = False Then

ActiveCell.Offset(1, 0).Select

End If

Loop Until IsEmpty(ActiveCell) = True
Dim rng As Range
ActiveCell.EntireRow.FillDown
On Error Resume Next
Set rng = ActiveCell.EntireRow.SpecialCells(xlConstants)
On Error GoTo 0
If Not rng Is Nothing Then
rng.ClearContents
End If

Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("GiM")

iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row













Antonov

finding row 7
 
The code is the one I've written. I cannot understand what blanks the cells.
"Tom Ogilvy" wrote in message
...
I would assume the solution would lie in adjusting your code to avoid doing
whatever it is doing.

Formulas don't disappear on there own, so identify the code that clears
the
formulas and adjust it.

--
Regards,
Tom Ogilvy

"antonov" wrote in message
.. .
I am trying to use the whole formula but there is one problem:
some of the cells contain formulas and when I run the userform all the
formula disappear... is there a way around it?
"Tom Ogilvy" wrote in message
...
Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("GiM")

iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
If iRow < 7 then iRow = 7

--
Regards,
Tom Ogilvy


"antonov" wrote in message
...
Hi Tom,
when I click on the command button the first code (you gave me) will

copy
the formulas down to the next row... but the second part of the code

will
input the data contained in the userform in row 3 (which is the first
empty
row). But I need the data to be input starting from row 7
"Tom Ogilvy" wrote in message
...
Range("A7").Select

says it is doing that already.

--
Regards,
Tom Ogilvy


"antonov" wrote in message
.. .
Hello everybody,
I have this code, which works fine... but I need the application to
start
looking for the first empty row starting from row 7... how can I do
that?

Private Sub CommandButton1_Click()

Range("A7").Select

Do

If IsEmpty(ActiveCell) = False Then

ActiveCell.Offset(1, 0).Select

End If

Loop Until IsEmpty(ActiveCell) = True
Dim rng As Range
ActiveCell.EntireRow.FillDown
On Error Resume Next
Set rng = ActiveCell.EntireRow.SpecialCells(xlConstants)
On Error GoTo 0
If Not rng Is Nothing Then
rng.ClearContents
End If

Dim iRow As Long
Dim ws As Worksheet
Set ws = Worksheets("GiM")

iRow = ws.Cells(Rows.Count, 1).End(xlUp).Offset(1, 0).Row
















All times are GMT +1. The time now is 07:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com