Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You don't need () when calling a sub
that's it, thank you :) "Tim Williams" <timjwilliams at gmail dot com píše v diskusním příspěvku ... "sheet", "index" and "column" aren't the best choices for variable names. Not sure if they are actually reserved words in VBA, but still best avoided. You don't need () when calling a sub delete_data "shtHM", 7, 23, 3 Tim -- Tim Williams Palo Alto, CA "Buddy Lee" wrote in message ... I need a sub procedure that deletes data on a definited sheet in a definited unnamed range(and only if background of the cell is yellow). I tried to write it but it doesn't work. When I call the sub procedure, visual basic says "syntax error" :( does anyone know why? Private Sub delete_data(sheet as string, ra, rb, column as integer) With Worksheets(sheet) For index = ra To rb If .Cells(index, column).Interior.ColorIndex = 6 Then .Cells(index, column) = "" End If Next index End With End Sub Private Sub cmdButton_Click() delete_data("shtHM",7,23,3) End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I copy a range of data to another sheet? | Excel Worksheet Functions | |||
Extracting/deleting select data from range of cell | Excel Discussion (Misc queries) | |||
how to transfer data from sheet to sheet with new range? | Excel Discussion (Misc queries) | |||
Deleting cell data without deleting formula | Excel Discussion (Misc queries) | |||
Deleting Range name's listed in the range address box. | Excel Discussion (Misc queries) |