Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 60
Default formatting inputbox

Question:

Can I make an inputbox vb anything? When I try this:

marker = InputBox("What is the row number in which the last Cost Center
number is located?", 32)

I get 32 as a title

When I try this:

marker = InputBox("What is the row number in which the last Cost Center
number is located?", vbSystemModal)

I get 32 as a title

When I try this (and lord only knows why I thought this might work!):

marker = InputBox("What is the row number in which the last Cost Center
number is located?", vbSystemModal = False)

I get an error of some sort that was so long ago (this morning) that I don't
remember.

I need the user to be able to look at the page I just pulled up for them and
count the number of rows. The data is coming to me from elsewhere and is
formated weirdly. So weirdly I thought it best to just ask the user.

If in case, dear helper, you are interested. I tried to count the rows from
the bottom up starting at a point in the data in which there are four
consecutive blank cells in column b. Using some manipulation of ActiveCell
offset several times over in which all of them are blank, etc. That was
yesterday evening. If you believe you have a more fruitful rendition I am
all ears.

Thanks,
Nicole
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default formatting inputbox

Nicole,

Try this

marker = Application.InputBox("What is the row number in which " & vbnewline
& _
"the last Cost Center number is located?", , , , , , , 1)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Nicole Seibert" wrote in message
...
Question:

Can I make an inputbox vb anything? When I try this:

marker = InputBox("What is the row number in which the last Cost Center
number is located?", 32)

I get 32 as a title

When I try this:

marker = InputBox("What is the row number in which the last Cost Center
number is located?", vbSystemModal)

I get 32 as a title

When I try this (and lord only knows why I thought this might work!):

marker = InputBox("What is the row number in which the last Cost Center
number is located?", vbSystemModal = False)

I get an error of some sort that was so long ago (this morning) that I

don't
remember.

I need the user to be able to look at the page I just pulled up for them

and
count the number of rows. The data is coming to me from elsewhere and is
formated weirdly. So weirdly I thought it best to just ask the user.

If in case, dear helper, you are interested. I tried to count the rows

from
the bottom up starting at a point in the data in which there are four
consecutive blank cells in column b. Using some manipulation of

ActiveCell
offset several times over in which all of them are blank, etc. That was
yesterday evening. If you believe you have a more fruitful rendition I am
all ears.

Thanks,
Nicole



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default formatting inputbox

Nicole Seibert wrote:

If in case, dear helper, you are interested. I tried to count the
rows from the bottom up starting at a point in the data in which
there are four consecutive blank cells in column b. Using some
manipulation of ActiveCell offset several times over in which all of
them are blank, etc. That was yesterday evening. If you believe you
have a more fruitful rendition I am all ears.


Are you counting from the "four consecutive cells" that are closest to the
top? I.e. if B8:B11 are blank and B13:B16 are blank, would the answer be 7
or 12? If 7, then the below code should do it. If 12, you'll need to
change your loop to a For Next loop and loop backward from the bottom.

Function CountRows(sh As Worksheet) As Long

Dim rCell As Range

For Each rCell In Intersect(sh.Columns(2), sh.UsedRange).Cells
If Not IsNull(rCell.Resize(4).FormulaArray) Then
If Len(rCell.Resize(4).FormulaArray) = 0 Then
If rCell.Row 1 Then
CountRows = rCell.Offset(-1, 0).Row
Else
CountRows = 0
End If
Exit Function
End If
End If
Next rCell

End Function


--
Dick Kusleika
MS MVP - Excel
www.dailydoseofexcel.com


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
InputBox peyman Excel Discussion (Misc queries) 4 September 28th 07 04:53 PM
InputBox ArthurJ Excel Programming 2 September 8th 05 03:18 PM
Inputbox and Application.InputBox Maria[_7_] Excel Programming 1 September 20th 04 11:36 AM
InputBox Hargrove Excel Programming 2 April 29th 04 07:43 PM
inputbox help lothario[_60_] Excel Programming 4 December 7th 03 12:26 AM


All times are GMT +1. The time now is 05:42 AM.

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

About Us

"It's about Microsoft Excel"