Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Macro for adding rows if two different columns have a value

Help! I need a macro to add a row after if the cell in column F has a value
and again if there is a value in column G
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Macro for adding rows if two different columns have a value

For Each c In Range("F2:F20") 'Or whatever size range
If c.Value "" And c.Offset(0, 1).Value 1 Then
c.Offset(1, 0).Resize(2, 1).EntireRow.Insert
ElseIf c.Value "" Then
c.Offset(1, 0).EntireRow.Insert
End If
Next




"Saveset" wrote in message
...
Help! I need a macro to add a row after if the cell in column F has a
value
and again if there is a value in column G



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Macro for adding rows if two different columns have a value

Thank you JLGWhiz! You are a Time saver for me! Also I appreciate the help
since I am just learning about the VBA process.

"JLGWhiz" wrote:

For Each c In Range("F2:F20") 'Or whatever size range
If c.Value "" And c.Offset(0, 1).Value 1 Then
c.Offset(1, 0).Resize(2, 1).EntireRow.Insert
ElseIf c.Value "" Then
c.Offset(1, 0).EntireRow.Insert
End If
Next




"Saveset" wrote in message
...
Help! I need a macro to add a row after if the cell in column F has a
value
and again if there is a value in column G



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Macro for adding rows if two different columns have a value

Thanks! This did exactly what I needed!!! I truely appreciate this since I am
just beginning to learn about Macros!

"JLGWhiz" wrote:

For Each c In Range("F2:F20") 'Or whatever size range
If c.Value "" And c.Offset(0, 1).Value 1 Then
c.Offset(1, 0).Resize(2, 1).EntireRow.Insert
ElseIf c.Value "" Then
c.Offset(1, 0).EntireRow.Insert
End If
Next




"Saveset" wrote in message
...
Help! I need a macro to add a row after if the cell in column F has a
value
and again if there is a value in column G



.

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
ADDING COLUMNS FOR COMMON ROWS JGAVIGAN Excel Discussion (Misc queries) 2 April 9th 10 03:06 AM
keep formulareferenses when adding columns or rows vito Excel Discussion (Misc queries) 3 April 8th 09 09:05 AM
macro from columns to rows but adding every time a new line [email protected] Excel Discussion (Misc queries) 2 December 7th 08 08:59 PM
adding more columns/rows Jo Davis Excel Discussion (Misc queries) 4 September 24th 08 07:57 PM
adding specifics columns and rows yodochi Excel Worksheet Functions 1 July 25th 07 03:24 AM


All times are GMT +1. The time now is 09:56 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"