Above cell
Solved/Closed
motorsito
-
Apr 22, 2009 at 02:12 PM
motorsito Posts 2 Registration date Tuesday April 21, 2009 Status Member Last seen April 23, 2009 - Apr 23, 2009 at 10:13 AM
motorsito Posts 2 Registration date Tuesday April 21, 2009 Status Member Last seen April 23, 2009 - Apr 23, 2009 at 10:13 AM
Related:
- Above cell
- An example of a cell is a blank cell ✓ - Programming Forum
- If cell contains date then return value ✓ - Excel Forum
- Excel "IF" function w/ date in test cell ✓ - Excel Forum
- Clear only the formatting from the selected cell (leaving the content) - Guide
- Excel formula to check if cell contains a date - Excel Forum
3 responses
aquarelle
Posts
7140
Registration date
Saturday April 7, 2007
Status
Moderator
Last seen
March 25, 2024
491
Apr 22, 2009 at 03:28 PM
Apr 22, 2009 at 03:28 PM
Hi,
1) Next time, it would be a good idea to salute people who could help you, OK ? ;)
2) Concerning your problem to write "different than above" in VBA, you just have to use <>
For example :
If Cell <> "0" then ...
Hope this help you.
Best regards
1) Next time, it would be a good idea to salute people who could help you, OK ? ;)
2) Concerning your problem to write "different than above" in VBA, you just have to use <>
For example :
If Cell <> "0" then ...
Hope this help you.
Best regards
motorsito
Posts
2
Registration date
Tuesday April 21, 2009
Status
Member
Last seen
April 23, 2009
Apr 22, 2009 at 05:04 PM
Apr 22, 2009 at 05:04 PM
Hi there, sorry for the lack of manners in the previous post, I apologize.
regarding yourtip, is helpful, no doubt, but it's not that simple, remember I need the whole frase "diferent than above", I know tha <> means "diferent than".
for example:for each c. in range("a1:a2000")
if c.value <> (here I need the frase"than above")then
selection.entirerow. insert
enf if
next
regarding yourtip, is helpful, no doubt, but it's not that simple, remember I need the whole frase "diferent than above", I know tha <> means "diferent than".
for example:for each c. in range("a1:a2000")
if c.value <> (here I need the frase"than above")then
selection.entirerow. insert
enf if
next
Maybe this will get you in the right direction.
Hope this helps!
Private Sub InsertRow()
Dim LastRow As Integer
Dim intRow As Integer
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
For intRow = LastRow To 2 Step -1
Rows(intRow).Select
If Cells(intRow, 1).Value <> Cells(intRow, 1).Offset(-1, 0).Value Then
Cells(intRow, 1).Select
Selection.EntireRow.Insert
End If
Next intRow
Range("A1").Select
End Sub
Hope this helps!
Private Sub InsertRow()
Dim LastRow As Integer
Dim intRow As Integer
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
For intRow = LastRow To 2 Step -1
Rows(intRow).Select
If Cells(intRow, 1).Value <> Cells(intRow, 1).Offset(-1, 0).Value Then
Cells(intRow, 1).Select
Selection.EntireRow.Insert
End If
Next intRow
Range("A1").Select
End Sub
Sorry, remove "Private" before Sub. I coded it in a command button first.
Sub InsertRow()
Dim LastRow As Integer
Dim intRow As Integer
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
For intRow = LastRow To 2 Step -1
Rows(intRow).Select
If Cells(intRow, 1).Value <> Cells(intRow, 1).Offset(-1, 0).Value Then
Cells(intRow, 1).Select
Selection.EntireRow.Insert
End If
Next intRow
Range("A1").Select
End Sub
Sub InsertRow()
Dim LastRow As Integer
Dim intRow As Integer
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
For intRow = LastRow To 2 Step -1
Rows(intRow).Select
If Cells(intRow, 1).Value <> Cells(intRow, 1).Offset(-1, 0).Value Then
Cells(intRow, 1).Select
Selection.EntireRow.Insert
End If
Next intRow
Range("A1").Select
End Sub
aquarelle
Posts
7140
Registration date
Saturday April 7, 2007
Status
Moderator
Last seen
March 25, 2024
491
Apr 23, 2009 at 08:37 AM
Apr 23, 2009 at 08:37 AM
Hi,
Arff, sorry for my misunderstanding, fortunately WutUp WutUp gave you the solution.
Have a nice day
Arff, sorry for my misunderstanding, fortunately WutUp WutUp gave you the solution.
Have a nice day
motorsito
Posts
2
Registration date
Tuesday April 21, 2009
Status
Member
Last seen
April 23, 2009
Apr 23, 2009 at 10:13 AM
Apr 23, 2009 at 10:13 AM
Good Morning to all,Great, with some minor changes to cutomize it, the solution from WutUp is the solution, thanks, it works great.