Replaces row instead of next avail
Closed
lost
-
Jan 18, 2012 at 12:35 PM
venkat1926
venkat1926
- Posts
- 1864
- Registration date
- Sunday June 14, 2009
- Status
- Contributor
- Last seen
- August 7, 2021
Related:
- Replaces row instead of next avail
- T-mobile sim card replacement - Guide
- Kodak easyshare software replacement - Download
- Paste data below the last used row - Guide
- Sony walkman nwz-b142f battery replacement ✓ - Forum - Hardware
- Excel create unique id for each row ✓ - Forum - Excel
1 reply
venkat1926
Jan 19, 2012 at 01:45 AM
- Posts
- 1864
- Registration date
- Sunday June 14, 2009
- Status
- Contributor
- Last seen
- August 7, 2021
Jan 19, 2012 at 01:45 AM
the macro works but does not give the answer you want.
when writing codes I suggest you have number of msgbox(s) so that you can easily debug and finally you can always remove these msbox(s)
suppose A7 is "a"
then your macro finds there is not "a" sheet and it creates a new sheet and calls it "a' and then copie form surce file the row 7 to row 1 of sheet1
you if condition is
that is if worksheets("A") exists
you have already created a sheet and called it "a" that means that answer to if condition is "yes" .
so the row 7 is copied to A1 row
where is the chance of "else" coming in
perhaps I am confused.
first time the pasting is done on the first row of new sheets
second time you run the macro now sheet("a") exist and "else" condition will come into effect and 7th row is pasted to second row.
everytime you run macro this will happen? Is this what you want
there is some confusion here. will you please explain the logic step by step so that the macro can be modified.
when writing codes I suggest you have number of msgbox(s) so that you can easily debug and finally you can always remove these msbox(s)
suppose A7 is "a"
then your macro finds there is not "a" sheet and it creates a new sheet and calls it "a' and then copie form surce file the row 7 to row 1 of sheet1
you if condition is
If Not Worksheets(rngCell.Text).Name <> "" Then
that is if worksheets("A") exists
you have already created a sheet and called it "a" that means that answer to if condition is "yes" .
so the row 7 is copied to A1 row
where is the chance of "else" coming in
perhaps I am confused.
first time the pasting is done on the first row of new sheets
second time you run the macro now sheet("a") exist and "else" condition will come into effect and 7th row is pasted to second row.
everytime you run macro this will happen? Is this what you want
there is some confusion here. will you please explain the logic step by step so that the macro can be modified.