Code to Skip a Row in Worksheet

April 2, 2009 by vba excel
Filed under: Excel Vba, Excel Worksheet 
Sponsor

Excel Vba Code to Skip a Row in Worksheet [Q] :

In the following excel vba macro to generate a report on a worksheet. I would like to have an empty excel row between the generated data rows.
Can I also assign a pointer to the cells e.g. ” ActiveCell.Offset(iSheet -
1, 1) = Worksheets(iSheet).[b4]. Pointer ” instead of the value.

Sub WorkbookReport()

Application.ScreenUpdating = False ‘DMcRitchie 2000-10-24
Application.Calculation = xlCalculationManual
Dim iSheet As Long
For iSheet = 1 To ActiveWorkbook.Worksheets.Count
ActiveCell.Offset(iSheet - 1, 0) = “‘” & Worksheets(iSheet).Name
ActiveCell.Offset(iSheet - 1, 1) = Worksheets(iSheet).[b4].Value
ActiveCell.Offset(iSheet - 1, 3) = Worksheets(iSheet).[g31].Value
ActiveCell.Offset(iSheet - 1, 5) = Worksheets(iSheet).[m31].Value
ActiveCell.Offset(iSheet - 1, 8) = Worksheets(iSheet).[s29].Value
ActiveCell.Offset(iSheet - 1, 10) = Worksheets(iSheet).[s31].Value

Next iSheet
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub

Thank you very much.

Excel Vba Code to Skip a Row in Worksheet [A]

This is excel vba macro code to skip a row in excel worksheet or workbook

Sub WorkbookReport()

Application.ScreenUpdating = False ‘DMcRitchie 2000-10-24
Application.Calculation = xlCalculationManual
Dim iSheet As Long
x = 0
For iSheet = 1 To ActiveWorkbook.Worksheets.Count
ActiveCell.Offset(iSheet + x - 1, 0) = “‘” & Worksheets(iSheet).Name
ActiveCell.Offset(iSheet + x - 1, 1) = Worksheets(iSheet).[b4].Value
ActiveCell.Offset(iSheet + x - 1, 3) = Worksheets(iSheet).[g31].Value
ActiveCell.Offset(iSheet + x - 1, 5) = Worksheets(iSheet).[m31].Value
ActiveCell.Offset(iSheet + x - 1, 8) = Worksheets(iSheet).[s29].Value
ActiveCell.Offset(iSheet + x - 1, 10) = Worksheets(iSheet).[s31].Value
x = x + 1
Next iSheet
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub

  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Google
  • E-mail this story to a friend!
  • Live
  • MisterWong
  • Propeller
  • StumbleUpon
  • Technorati
  • TwitThis
  • YahooMyWeb
  • Print this article!

Rate This Tips:

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...


Incoming excel search terms

vba skip,excel skip rows,skip vba,how to skip rows in excel,vba for next skip,skip function in vba,skip row in vba,vba excel offset,excel formula skip rows,skip row vba,vba for skip,vba skip line,vba skip row,,excel vba for next skip,excel vba skip,excel vba skip code,skip row in excel,skip rows in excel,excel skipping rows,excel vba offset,excel vba skip blank rows,how to skip a line in excel,mss,skip a row in excel,skip excel,skip in vba,vba activecell offset,vba excel skip row empty,vba for each skip,vba row skip,vba skip a row,access vba import excel skip first row,activecell offset vba,application calculation vba,excel skip,excel skip a line with zero value in a worksheet,excel skip row,excel vba for each skip,excel vba sumifs formula value insert,how to skip lines in excel,how to skip rows in vba,ignore row vba,skip a row vba excel macro,skip code in vba,skip row excel,skip rows in vba,skip rows with macro,vba excel skip,vba excel skip line



Related Excel Tips

Comments

Have another excel answer or questions for this problem ?
Feel free to post it here..