Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #8  
Old 12-21-2010, 04:51 AM
BjornS BjornS is offline creating macro for biffurcation in sheets according to data. Windows Vista creating macro for biffurcation in sheets according to data. Office 2003
Competent Performer
 
Join Date: Jan 2010
Location: Sweden
Posts: 116
BjornS is on a distinguished road
Default Last row...

Hi,
to know the last row of the "state column" (AB) which is taken into account, there are a number of ways to get this info.

Either extend the existing macro by:
Cells(1, 1) = LastRow1
Put this just before "End Sub", then cell A1 of the sheet "Original" will show you the value.

You can also implement the additional macro below. In this version it gives a popup-message, showing the last column of the column you have activated.
By removing the remark symbol of the command "ActiveCell.Value = LastRow1", you can also have the value written in the current cell (whatever fits you best).

Kind regards
Bjorn


Sub LastRow()
Dim LastRow1 As Long
Dim i As integer

With ActiveSheet
LastRow1 = .Cells(.Rows.Count, ActiveCell.Column).End(xlUp).Row
End With

i = MsgBox("Last Row for this column is " & LastRow1, vbOKOnly + vbInformation)

' ActiveCell.Value = LastRow1

End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a MACRO Nikb3522 Word VBA 0 10-21-2010 05:55 PM
creating macro for biffurcation in sheets according to data. How to syncronize data in two different sheets diegogeid Excel 2 09-30-2010 12:19 AM
creating macro steveb Word VBA 0 08-14-2010 01:29 AM
creating macro for biffurcation in sheets according to data. How do I merge data from one sheet in a workbook out into multiple sheets nolesca Excel 4 06-07-2010 08:13 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:47 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft