Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 45
Default how to delete a row index when row is blank

I have the following code that works fine, however when a task status is
compleetd and when the next task is in satrted status, the sheet 2 which
puklls data from sheet1 has a blank line whenever te statu sin sheet 1 is
completed. what shud i add inside my code so taht i don get blank rows in
sheet2.

Sub automateFTP()
'bringing in ProjectName_taskname from was into FTP

Sheets("WAS").Activate
J = 6 'WAS entries start from 6th row . so j=6
I = 4 'FTP entries start from 4th row. so i=4

While Cells(J, 4).Value < ""

If (Cells(J, 15).Value < "Completed") Then

Sheets("FTP").Cells(I, 3) = Cells(J, 4).Value & "_" & Cells(J, 5).Value
Sheets("FTP").Cells(I, 2) = Cells(J, 6).Value

End If

I = I + 1
J = J + 1

Wend
Sheets("FTP").Activate
End Sub








  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default how to delete a row index when row is blank

Hi

Move your I = I+1 inside the If statement, so that it only gets incremented
if the Was.Cells(J,15) = "Completed".

If (Cells(J, 15).Value < "Completed") Then
Sheets("FTP").Cells(I, 3) = Cells(J, 4).Value & "_" & Cells(J, 5).Value
Sheets("FTP").Cells(I, 2) = Cells(J, 6).Value
I = I + 1
End If

J = J + 1

--
Regards
Roger Govier

"deepika :excel help" wrote in
message ...
I have the following code that works fine, however when a task status is
compleetd and when the next task is in satrted status, the sheet 2 which
puklls data from sheet1 has a blank line whenever te statu sin sheet 1 is
completed. what shud i add inside my code so taht i don get blank rows in
sheet2.

Sub automateFTP()
'bringing in ProjectName_taskname from was into FTP

Sheets("WAS").Activate
J = 6 'WAS entries start from 6th row . so j=6
I = 4 'FTP entries start from 4th row. so i=4

While Cells(J, 4).Value < ""

If (Cells(J, 15).Value < "Completed") Then

Sheets("FTP").Cells(I, 3) = Cells(J, 4).Value & "_" & Cells(J, 5).Value
Sheets("FTP").Cells(I, 2) = Cells(J, 6).Value

End If

I = I + 1
J = J + 1

Wend
Sheets("FTP").Activate
End Sub








  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 45
Default how to delete a row index when row is blank

Hey Roger thank you . It worked well. Now everytime when the macro is run ,
my second sheet should first empty the existing contents of the sheet 2 from
row 4 to ... row n(FTP sheet frm i=-4) and then bring in the required
entries... what kind of delete stmt should i write inside teh macro

"Roger Govier" wrote:

Hi

Move your I = I+1 inside the If statement, so that it only gets incremented
if the Was.Cells(J,15) = "Completed".

If (Cells(J, 15).Value < "Completed") Then
Sheets("FTP").Cells(I, 3) = Cells(J, 4).Value & "_" & Cells(J, 5).Value
Sheets("FTP").Cells(I, 2) = Cells(J, 6).Value
I = I + 1
End If

J = J + 1

--
Regards
Roger Govier

"deepika :excel help" wrote in
message ...
I have the following code that works fine, however when a task status is
compleetd and when the next task is in satrted status, the sheet 2 which
puklls data from sheet1 has a blank line whenever te statu sin sheet 1 is
completed. what shud i add inside my code so taht i don get blank rows in
sheet2.

Sub automateFTP()
'bringing in ProjectName_taskname from was into FTP

Sheets("WAS").Activate
J = 6 'WAS entries start from 6th row . so j=6
I = 4 'FTP entries start from 4th row. so i=4

While Cells(J, 4).Value < ""

If (Cells(J, 15).Value < "Completed") Then

Sheets("FTP").Cells(I, 3) = Cells(J, 4).Value & "_" & Cells(J, 5).Value
Sheets("FTP").Cells(I, 2) = Cells(J, 6).Value

End If

I = I + 1
J = J + 1

Wend
Sheets("FTP").Activate
End Sub









  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,480
Default how to delete a row index when row is blank

Hi

Sheets("FTP").Activate
Range(Cells(4, 1), ActiveCell.SpecialCells(xlLastCell)).EntireRow.Del ete

--
Regards
Roger Govier

"deepika :excel help" wrote in
message ...
Hey Roger thank you . It worked well. Now everytime when the macro is run
,
my second sheet should first empty the existing contents of the sheet 2
from
row 4 to ... row n(FTP sheet frm i=-4) and then bring in the required
entries... what kind of delete stmt should i write inside teh macro

"Roger Govier" wrote:

Hi

Move your I = I+1 inside the If statement, so that it only gets
incremented
if the Was.Cells(J,15) = "Completed".

If (Cells(J, 15).Value < "Completed") Then
Sheets("FTP").Cells(I, 3) = Cells(J, 4).Value & "_" & Cells(J, 5).Value
Sheets("FTP").Cells(I, 2) = Cells(J, 6).Value
I = I + 1
End If

J = J + 1

--
Regards
Roger Govier

"deepika :excel help" wrote
in
message ...
I have the following code that works fine, however when a task status
is
compleetd and when the next task is in satrted status, the sheet 2
which
puklls data from sheet1 has a blank line whenever te statu sin sheet 1
is
completed. what shud i add inside my code so taht i don get blank rows
in
sheet2.

Sub automateFTP()
'bringing in ProjectName_taskname from was into FTP

Sheets("WAS").Activate
J = 6 'WAS entries start from 6th row . so j=6
I = 4 'FTP entries start from 4th row. so i=4

While Cells(J, 4).Value < ""

If (Cells(J, 15).Value < "Completed") Then

Sheets("FTP").Cells(I, 3) = Cells(J, 4).Value & "_" & Cells(J, 5).Value
Sheets("FTP").Cells(I, 2) = Cells(J, 6).Value

End If

I = I + 1
J = J + 1

Wend
Sheets("FTP").Activate
End Sub









Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Index/match - make blank cells return a blank value. diaare Excel Worksheet Functions 3 May 3rd 23 03:44 AM
I want to index the first blank cell in a column of data Bruce Henson Excel Discussion (Misc queries) 3 February 23rd 06 08:07 PM
"BLANK" - need to delete anjgoss Excel Worksheet Functions 3 August 25th 05 05:31 PM
Delete Blank Lines Charles Excel Discussion (Misc queries) 3 August 8th 05 05:11 PM
index match with blank entries andrewm Excel Worksheet Functions 2 July 9th 05 10:44 AM


All times are GMT +1. The time now is 12:42 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"