Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default macro to delete specific row with queries embedded

Hi everyone

im trying to compile a excel sheet that retrieves data from yahoo
finance
i made 12 web queries (each one has 66 rows of data),each one for a
different page of data for the same company stock
and i adjusted the query to refresh for query 1 (row 1 -66) ,query 2
(row 67-133)...and so on

i also placed a macro to delete rows that have 0 data or have words as
data
but somehow executing the macro deletes the row as well as the embedded
webquery in the sheet
and if i refresh the query again ,the data is messed up,much shorter
than before as compered with if i dont delete .

Please advise me on how to tweak this as it is pretty urgent (need it
by next week)
if u want i can send u the excel file to check
Thank you so much

Regards
Mervyn





macro is as below

Sub aaacut()
'
' aaacut Macro
' Macro recorded 07/11/2006 by Mervyn Teo
'
Call DeleteRows
End Sub

'
Public Sub DeleteRows()


Dim R As Long
Dim C As Range
Dim Rng As Range


On Error GoTo EndMacro
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual


If Selection.Rows.Count 1 Then
Set Rng = Selection
Else
Set Rng = ActiveSheet.UsedRange.Rows
End If
For R = Rng.Rows.Count To 1 Step -1
If Cells(R, "C").Value = "" Then
Rng.Rows(R).EntireRow.Delete
ElseIf Cells(R, "C").Value = "High" Then
Rng.Rows(R).EntireRow.Delete
End If
Next R


EndMacro:


Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic


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
macro to keep specific name colomns and delete all others myshak Excel Discussion (Misc queries) 0 March 9th 09 11:01 PM
Embedded queries... James McDowell[_2_] Excel Programming 4 February 1st 06 06:43 PM
Find xls with embedded queries boreal Excel Programming 0 October 26th 05 10:37 PM
delete row contains specific word in an macro Jean-Francois Excel Discussion (Misc queries) 4 January 11th 05 11:40 PM
Macro to delete specific rows Steve Excel Programming 12 October 1st 04 11:50 PM


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

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

About Us

"It's about Microsoft Excel"