Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I know I can use the code below to clear data from a range, but I need to
clear data from rng(1, 43) through rng(1, 125). Is there any way to do that without having to write a line for each rng to be cleared? Sub ClearData() Dim rng Set rng = Cells(ActiveCell.Row, 1) rng(1, 43).Value = "" End Sub |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is this what you need?
set rng = Range(Cells(1,43),Cells(1,125)) rng.clearcontents -- If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "Patrick C. Simonds" wrote: I know I can use the code below to clear data from a range, but I need to clear data from rng(1, 43) through rng(1, 125). Is there any way to do that without having to write a line for each rng to be cleared? Sub ClearData() Dim rng Set rng = Cells(ActiveCell.Row, 1) rng(1, 43).Value = "" End Sub |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Maybe this: Range(Cells(ActiveCell.Row, 43), Cells(ActiveCell.Row, 125)).ClearContents Regards, Per "Patrick C. Simonds" skrev i meddelelsen ... I know I can use the code below to clear data from a range, but I need to clear data from rng(1, 43) through rng(1, 125). Is there any way to do that without having to write a line for each rng to be cleared? Sub ClearData() Dim rng Set rng = Cells(ActiveCell.Row, 1) rng(1, 43).Value = "" End Sub |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim rng As Range
Set rng = ActiveSheet.Range(Cells(1, 43), Cells(1, 125)) With rng .Value = "" End With Or more simply.................. ActiveSheet.Range(Cells(1, 43), Cells(1, 125)).Value = "" Gord Dibben MS Excel MVP On Mon, 16 Mar 2009 11:27:04 -0700, "Patrick C. Simonds" wrote: I know I can use the code below to clear data from a range, but I need to clear data from rng(1, 43) through rng(1, 125). Is there any way to do that without having to write a line for each rng to be cleared? Sub ClearData() Dim rng Set rng = Cells(ActiveCell.Row, 1) rng(1, 43).Value = "" End Sub |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could always do this...
Sub ClearData() Range("AQ1:DU1").ClearContents End Sub -- Rick (MVP - Excel) "Patrick C. Simonds" wrote in message ... I know I can use the code below to clear data from a range, but I need to clear data from rng(1, 43) through rng(1, 125). Is there any way to do that without having to write a line for each rng to be cleared? Sub ClearData() Dim rng Set rng = Cells(ActiveCell.Row, 1) rng(1, 43).Value = "" End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Clear Range | Excel Programming | |||
Sub to clear range above n below diagonal | Excel Programming | |||
clear range of cells if another becomes blank | Excel Worksheet Functions | |||
Clear Contents of a Selected Range | Excel Programming | |||
Clear data range, and copy static value. | Excel Programming |