Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 28th, 2009, 09:36 PM
Registered User
 
Join Date: May 2009
Posts: 7
Thanks: 1
Thanked 0 Times in 0 Posts
Smile help me please

hi, i want to write a code, that is searching for blank cell in column I, then the cursor will go to the cell that is blank. there are alot of worksheets to go through and the user may not input into the blank cell, so they will run the macro agian to search for another blank cell, my problem is, i duno how to loop to another worksheet since that 1 is still blank.
thanks

here is my code.



Dim wb As Workbook
Dim ws As Worksheet

Set wb = ActiveWorkbook

For Each ws In wb.Worksheets

LastRow = [A65536].End(xlUp).Row
ws.Activate
For intK = 6 To LastRow

If (ws.Cells(intK, "G").Value = "") Then
Exit For
End If

If (ws.Cells(intK, "I").Value = "") Then
ws.Cells(intK, "I").Activate
Exit Sub

End If

Next

Next
 
Old May 28th, 2009, 10:12 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 812
Thanks: 1
Thanked 53 Times in 49 Posts
Default

Do you want the user to enter some value in blank cells?

IF that is the case, you can use InputBox

http://vbadud.blogspot.com/2006/12/e...-inputbox.html
http://vbadud.blogspot.com/2007/08/d...excel-vba.html
http://msdn.microsoft.com/en-us/libr...k5(VS.85).aspx

Whenever you are activating the particular sheet - scroll to that location (http://vbadud.blogspot.com/2008/04/s...using-vba.html) and display the inputbox

Then fill the value of the input box and move ahead
__________________
C# Code Snippets (http://www.dotnetdud.blogspot.com)

VBA Tips & Tricks (http://www.vbadud.blogspot.com)









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.