Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Every 4th cell is blank and stops my macro!


I am trying to run the following Macro and I'm not having any troubl
except every 4th row in the dataset is blank, causing this macro t
stop dead in its tracks. What can I do to add "filler" data in ever
4th row for the length of the dataset or perhaps delete every 4th ro
and move the data up?

Thanks particularly to Tom O. who has been a great help this week.

Dim rng As Range
With Worksheets("Sheet1")
Set rng = .Range(.Cells(2, 1), .Cells(2, 1).End(xlDown))
End With
With Worksheets("Sheet2")
.Range(rng.Address).FormulaR1C1 = "=Sheet1!RC"
End Wit

--
Sandema
-----------------------------------------------------------------------
Sandeman's Profile: http://www.excelforum.com/member.php...fo&userid=3244
View this thread: http://www.excelforum.com/showthread.php?threadid=52358

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Every 4th cell is blank and stops my macro!

Dim rng As Range
With Worksheets("Sheet1")

Set rng = .Range(.Cells(2, 1), .Cells(Rows.Count 1).End(xlUp))

End With
With Worksheets("Sheet2")
Range(rng.Address).FormulaR1C1 = "=Sheet1!RC"
End With

HTH
--
AP

"Sandeman" a écrit
dans le message de
...

I am trying to run the following Macro and I'm not having any trouble
except every 4th row in the dataset is blank, causing this macro to
stop dead in its tracks. What can I do to add "filler" data in every
4th row for the length of the dataset or perhaps delete every 4th row
and move the data up?

Thanks particularly to Tom O. who has been a great help this week.

Dim rng As Range
With Worksheets("Sheet1")
Set rng = .Range(.Cells(2, 1), .Cells(2, 1).End(xlDown))
End With
With Worksheets("Sheet2")
Range(rng.Address).FormulaR1C1 = "=Sheet1!RC"
End With


--
Sandeman
------------------------------------------------------------------------
Sandeman's Profile:

http://www.excelforum.com/member.php...o&userid=32440
View this thread: http://www.excelforum.com/showthread...hreadid=523586



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Every 4th cell is blank and stops my macro!


Nevermind. I think I figured this out. Google is your friend

--
Sandema
-----------------------------------------------------------------------
Sandeman's Profile: http://www.excelforum.com/member.php...fo&userid=3244
View this thread: http://www.excelforum.com/showthread.php?threadid=52358

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Every 4th cell is blank and stops my macro!

Dim rng As Range
With Worksheets("Sheet1")
Set rng = .Range(.Cells(2, 1), .Cells(rows.count, 1).End(xlUp))
End With
With Worksheets("Sheet2")
..Range(rng.Address).FormulaR1C1 = "=Sheet1!RC"
End With

or if you want to delete the rows

Dim rng As Range
With Worksheets("Sheet1")
Set rng = .Range(.Cells(2, 1), .Cells(rows.count, 1).End(xlUp))
rng.specialcells(xlblanks).Entirerow.Delete
Set rng = .Range(.Cells(2, 1), .Cells(rows.count, 1).End(xlUp))
End With
With Worksheets("Sheet2")
..Range(rng.Address).FormulaR1C1 = "=Sheet1!RC"
End With

--
Regards,
Tom Ogilvy


"Sandeman" wrote:


I am trying to run the following Macro and I'm not having any trouble
except every 4th row in the dataset is blank, causing this macro to
stop dead in its tracks. What can I do to add "filler" data in every
4th row for the length of the dataset or perhaps delete every 4th row
and move the data up?

Thanks particularly to Tom O. who has been a great help this week.

Dim rng As Range
With Worksheets("Sheet1")
Set rng = .Range(.Cells(2, 1), .Cells(2, 1).End(xlDown))
End With
With Worksheets("Sheet2")
.Range(rng.Address).FormulaR1C1 = "=Sheet1!RC"
End With


--
Sandeman
------------------------------------------------------------------------
Sandeman's Profile: http://www.excelforum.com/member.php...o&userid=32440
View this thread: http://www.excelforum.com/showthread...hreadid=523586


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
Sum used in macro where range stops at first non numerical cell Carol Excel Worksheet Functions 1 July 11th 09 03:57 AM
Macro repeats and then stops Sabba Efie Excel Discussion (Misc queries) 2 August 15th 06 11:03 PM
My Macro stops Bobby Excel Programming 1 January 23rd 06 07:00 PM
Macro stops before beginning. y Excel Programming 7 April 12th 04 06:06 AM
macro stops midstream dvt[_2_] Excel Programming 3 February 23rd 04 03:46 PM


All times are GMT +1. The time now is 04:57 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"