Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Input Box Code Please Help!!

Hello,

Okay I have an inout box that ask how many rows do you
want to insert...I am trying to combine these two codes to
bring me back the correct results...can someone please
point help me...have been workingon this for the past two
hours with no luck...below are the two codes

This is the input box code:

Private Sub cbutInsert_Click()
ORIGSHT = ActiveSheet.Name
ORIGROW = ActiveCell.Row
ORIGADR = ActiveCell.Address
ORIGCOL = Replace(Replace(ORIGADDR, "$", "", 1),
CMNDROW, "", 1)

If TextBox1.Value < "" Then
ActiveCell.Resize(TextBox1.Value, 1).EntireRow.Insert
Else
ActiveCell.Resize(1, 1).EntireRow.Insert
End If
Unload Me
End Sub

This is the results code:

Sub insertrowswithformulas()
With ActiveCell
..EntireRow.Insert
Range(Cells(.Row - 2, "I"), Cells(.Row - 2, "AP")).Copy_
Cells(.Row - 1, "I"))
Range(Cells(.Row - 2, "B"), Cells(.Row - 2, "G")).Copy_
Cells(.Row - 1, "B"))

End With
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Input Box Code Please Help!!

In response to a previous post (quite a while ago), I provided code that
does this. So it is unclear why you are struggling.

there is no relationship between the two sets of code you show now. Your
first offering appears to be a commandbutton on a userform rather than an
inputbox as you say.

Your second offering (which is the basic code modifed by you and which I
then modified in response to your previous posting) isn't called by that
sub, so it is unclear by what you mean by results code.

--
Regards,
Tom Ogilvy

"Struggling Hard!!" wrote in message
...
Hello,

Okay I have an inout box that ask how many rows do you
want to insert...I am trying to combine these two codes to
bring me back the correct results...can someone please
point help me...have been workingon this for the past two
hours with no luck...below are the two codes

This is the input box code:

Private Sub cbutInsert_Click()
ORIGSHT = ActiveSheet.Name
ORIGROW = ActiveCell.Row
ORIGADR = ActiveCell.Address
ORIGCOL = Replace(Replace(ORIGADDR, "$", "", 1),
CMNDROW, "", 1)

If TextBox1.Value < "" Then
ActiveCell.Resize(TextBox1.Value, 1).EntireRow.Insert
Else
ActiveCell.Resize(1, 1).EntireRow.Insert
End If
Unload Me
End Sub

This is the results code:

Sub insertrowswithformulas()
With ActiveCell
.EntireRow.Insert
Range(Cells(.Row - 2, "I"), Cells(.Row - 2, "AP")).Copy_
Cells(.Row - 1, "I"))
Range(Cells(.Row - 2, "B"), Cells(.Row - 2, "G")).Copy_
Cells(.Row - 1, "B"))

End With
End Sub



  #3   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Input Box Code Please Help!!

You are correct there is nno relationship right
now....this is what I am trying to do...relate the
two....and yes it is a command button on a user form that
pops up a box asking to enter the number of rows...I want
to use the form to input a number of rows and ..using the
what I call results code...to do this....insert lets say 5
rows, and copy the formulas from down the row above into
the newly inserted rows specified from specified columns (
b thur G) and then (H thur AP).....


-----Original Message-----
In response to a previous post (quite a while ago), I

provided code that
does this. So it is unclear why you are struggling.

there is no relationship between the two sets of code you

show now. Your
first offering appears to be a commandbutton on a

userform rather than an
inputbox as you say.

Your second offering (which is the basic code modifed by

you and which I
then modified in response to your previous posting) isn't

called by that
sub, so it is unclear by what you mean by results code.

--
Regards,
Tom Ogilvy

"Struggling Hard!!"

wrote in message
...
Hello,

Okay I have an inout box that ask how many rows do you
want to insert...I am trying to combine these two codes

to
bring me back the correct results...can someone please
point help me...have been workingon this for the past

two
hours with no luck...below are the two codes

This is the input box code:

Private Sub cbutInsert_Click()
ORIGSHT = ActiveSheet.Name
ORIGROW = ActiveCell.Row
ORIGADR = ActiveCell.Address
ORIGCOL = Replace(Replace(ORIGADDR, "$", "", 1),
CMNDROW, "", 1)

If TextBox1.Value < "" Then
ActiveCell.Resize(TextBox1.Value,

1).EntireRow.Insert
Else
ActiveCell.Resize(1, 1).EntireRow.Insert
End If
Unload Me
End Sub

This is the results code:

Sub insertrowswithformulas()
With ActiveCell
.EntireRow.Insert
Range(Cells(.Row - 2, "I"), Cells(.Row - 2, "AP")).Copy_
Cells(.Row - 1, "I"))
Range(Cells(.Row - 2, "B"), Cells(.Row - 2, "G")).Copy_
Cells(.Row - 1, "B"))

End With
End Sub



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Input Box Code Please Help!!

Then you should use the code I provided you and just replace the inputbox
part of that with showing your Userform. The click event should just hide
the form and you can then retrieve the number of rows from the textbox.

--
Regards,
Tom Ogilvy

wrote in message
...
You are correct there is nno relationship right
now....this is what I am trying to do...relate the
two....and yes it is a command button on a user form that
pops up a box asking to enter the number of rows...I want
to use the form to input a number of rows and ..using the
what I call results code...to do this....insert lets say 5
rows, and copy the formulas from down the row above into
the newly inserted rows specified from specified columns (
b thur G) and then (H thur AP).....


-----Original Message-----
In response to a previous post (quite a while ago), I

provided code that
does this. So it is unclear why you are struggling.

there is no relationship between the two sets of code you

show now. Your
first offering appears to be a commandbutton on a

userform rather than an
inputbox as you say.

Your second offering (which is the basic code modifed by

you and which I
then modified in response to your previous posting) isn't

called by that
sub, so it is unclear by what you mean by results code.

--
Regards,
Tom Ogilvy

"Struggling Hard!!"

wrote in message
...
Hello,

Okay I have an inout box that ask how many rows do you
want to insert...I am trying to combine these two codes

to
bring me back the correct results...can someone please
point help me...have been workingon this for the past

two
hours with no luck...below are the two codes

This is the input box code:

Private Sub cbutInsert_Click()
ORIGSHT = ActiveSheet.Name
ORIGROW = ActiveCell.Row
ORIGADR = ActiveCell.Address
ORIGCOL = Replace(Replace(ORIGADDR, "$", "", 1),
CMNDROW, "", 1)

If TextBox1.Value < "" Then
ActiveCell.Resize(TextBox1.Value,

1).EntireRow.Insert
Else
ActiveCell.Resize(1, 1).EntireRow.Insert
End If
Unload Me
End Sub

This is the results code:

Sub insertrowswithformulas()
With ActiveCell
.EntireRow.Insert
Range(Cells(.Row - 2, "I"), Cells(.Row - 2, "AP")).Copy_
Cells(.Row - 1, "I"))
Range(Cells(.Row - 2, "B"), Cells(.Row - 2, "G")).Copy_
Cells(.Row - 1, "B"))

End With
End Sub



.



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
How to modify the code for different type of input? Eric Excel Worksheet Functions 1 September 1st 07 03:58 PM
How to modify the code for different type of input? Eric Excel Discussion (Misc queries) 2 September 1st 07 12:30 AM
Code for Input Box Laura C Excel Programming 4 June 29th 04 05:27 PM
CODE to select range based on User Input or Value of Input Field Sandi Gauthier Excel Programming 4 December 8th 03 03:22 PM
1.)Input Boxes 2.) Condensing a Code David W[_3_] Excel Programming 2 July 17th 03 11:51 PM


All times are GMT +1. The time now is 12:41 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"