cancel
Showing results for 
Search instead for 
Did you mean: 

VBA Help

Peter Edwards
Occasional Visitor

VBA Help

Hi all,

I is new here and a complete PC thicky so take it easy ;)

I need a Excel 97 macro that moves down 26 rows, hightlights the next 6 rows and deletes them, then moves down 26 rows, highlights next 6 rows and deletes them. Loops until a blank in column 1?

Any help?

This is my shamblee effort:

Sub ad800_ind()
'
' ad800_ind Macro
Workbooks.OpenText FileName:="J:\GLOBCUST\UTA\AD800.txt", Origin:=xlWindows _
, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(0, 1)

Rows("1:35").Select
Selection.Delete Shift:=xlUp
y = 1
Do Until Cells(y, 1) = ""
'Rows("y:y+5").Select
Selection.Delete Shift:=x1up
y = y + 26
Loop

End Sub

Help please

Thankyou :)
I just lub dem Jubblies :)
1 REPLY
Ron Bromwell
Frequent Advisor

Re: VBA Help

Attached is a VB program I use for tracking volume sizes.

A couple things to keep in mind:
1. Create a new excel application with
Set oExcel = New Excel.Application

2. Tell VB the location of the spread sheet
Set oBook = oExcel.Workbooks.Open _
("C:\daily_checks\" + strYear + "\"+ strMonth + "\" + _
strMonth + strYear + ".xls")

3. Set an active sheet.
Set oSheet = oExcel.ActiveSheet


4. If you create a macro to do what you are trying to do, then go in a edit the macro, you should be able to get a basic understanding of the commands you need to execute to accomplish this.

Hope this helps
life's a journey, not a destination