Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default help with code

hi I have this part of a code:

If IsError(.Cells(Lrow, "E").Value) Then
ElseIf .Cells(Lrow, "E").Value = "2" And _
.Cells(Lrow, "G").Value < 0 Then .Rows(Lrow).Delete

but instead of having value "2" i'd prefer to have a box pop up that askes
me for this value each time, something like this I guess:

Dim V As Variant
V = Application.InputBox(prompt:="Enter number of month.", Type:=1)
If V = False Then
Debug.Print "User clicked cancel"

but how do I combine the 2 parts of code? any suggestions?

S.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default help with code

try Inputbox. See excel help menu in visual Basic window.

"steven" wrote:

hi I have this part of a code:

If IsError(.Cells(Lrow, "E").Value) Then
ElseIf .Cells(Lrow, "E").Value = "2" And _
.Cells(Lrow, "G").Value < 0 Then .Rows(Lrow).Delete

but instead of having value "2" i'd prefer to have a box pop up that askes
me for this value each time, something like this I guess:

Dim V As Variant
V = Application.InputBox(prompt:="Enter number of month.", Type:=1)
If V = False Then
Debug.Print "User clicked cancel"

but how do I combine the 2 parts of code? any suggestions?

S.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default help with code

sorry guess i am as newbe as it gets... can't figure this out... can anyone
help me out with the code?

thanks.

"Joel" wrote:

try Inputbox. See excel help menu in visual Basic window.

"steven" wrote:

hi I have this part of a code:

If IsError(.Cells(Lrow, "E").Value) Then
ElseIf .Cells(Lrow, "E").Value = "2" And _
.Cells(Lrow, "G").Value < 0 Then .Rows(Lrow).Delete

but instead of having value "2" i'd prefer to have a box pop up that askes
me for this value each time, something like this I guess:

Dim V As Variant
V = Application.InputBox(prompt:="Enter number of month.", Type:=1)
If V = False Then
Debug.Print "User clicked cancel"

but how do I combine the 2 parts of code? any suggestions?

S.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default help with code

Sorry
Note: the original code had "2" in the inputbox which indicated 2 was a
string. The Input box 2 is for text like the old code, if you waqnt a number
then change the 2 to a 1.


Dim V As string
If IsError(.Cells(Lrow, "E").Value) Then

V = Application.InputBox(prompt:="Enter number of month.", Type:=2)
If V = False Then
Debug.Print "User clicked cancel"
Else
if .Cells(Lrow, "E").Value = V And _
.Cells(Lrow, "G").Value < 0 Then .Rows(Lrow).Delete
end if
end if


Dim V As Variant
V = Application.InputBox(prompt:="Enter number of month.", Type:=1)
If V = False Then
Debug.Print "User clicked cancel"



"steven" wrote:

sorry guess i am as newbe as it gets... can't figure this out... can anyone
help me out with the code?

thanks.

"Joel" wrote:

try Inputbox. See excel help menu in visual Basic window.

"steven" wrote:

hi I have this part of a code:

If IsError(.Cells(Lrow, "E").Value) Then
ElseIf .Cells(Lrow, "E").Value = "2" And _
.Cells(Lrow, "G").Value < 0 Then .Rows(Lrow).Delete

but instead of having value "2" i'd prefer to have a box pop up that askes
me for this value each time, something like this I guess:

Dim V As Variant
V = Application.InputBox(prompt:="Enter number of month.", Type:=1)
If V = False Then
Debug.Print "User clicked cancel"

but how do I combine the 2 parts of code? any suggestions?

S.

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
split post code (zip code) out of cell that includes full address Concord Excel Discussion (Misc queries) 4 October 15th 09 06:59 PM
Shorten code to apply to all sheets except a few, instead of individually naming them, and later adding to code. Corey Excel Programming 3 December 11th 06 05:14 AM
Protect Sheet with code, but then code will not Paste error. How do i get around this. Please read for explainations.... Corey Excel Programming 4 November 25th 06 04:57 AM
Modification in the CODE to HIDE rows and columns that start with ZERO (code given) Thulasiram[_2_] Excel Programming 4 September 26th 06 04:15 AM
Excel code convert to Access code - Concat & eliminate duplicates italia Excel Programming 1 September 12th 06 12:14 AM


All times are GMT +1. The time now is 10:03 PM.

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"