Auto Fill and Manual Entry

Redm4n83

New Member
Joined
Aug 17, 2016
Messages
19
Hi there.

Another silly question for the day.

ABCD
1DateLow TideHigh TideMoon
21/2/1806:3013:00Full
32/2/1807:1513:451 Day Past Full
42/2/18

<tbody>
</tbody>

Take for instance the above table, As an example i have entered into A3 and A4 the same dates, Obviously the same calendar dates will have the same tide times and moon phase.

I am looking for a code that will auto generate Low Tide, High Tide and Moon phase from the previous line, But i would like to be able to manually enter the information for when the calendar dates are a new day.
This is part of a large table that generates new lines on a new entry, so i will need some way of coding this so that when i manually enter the information on a new date the code does not disappear and will auto generate again if i duplicate days.

This seems a little silly, but i am trying to create a fishing log to log and track the fish we catch for the season.

Is this at all possible?


Cheers
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Try this:
This is an auto sheet event script
Your Workbook must be Macro enabled
To install this code:
Right-click on the sheet tab
Select View Code from the pop-up context menu
Paste the code in the VBA edit window

If you enter: Cake in Range("A2") and then enter "Cake" in Range("A3")
Rows 3 will be a duplicate of Row(2)

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 And Target.Row > 1 And Target.Cells.Count = 1 Then
If Target.Value = Target.Offset(-1, 0).Value Then
Application.EnableEvents = False
Rows(Target.Row).Value = Rows(Target.Row - 1).Value
Application.EnableEvents = True
End If
End If
End Sub
 
Upvote 0
Ok.. So i should be heading towards the VB side of things,
Next question is, As there are only a few columns i need to duplicate onto the next row, And each row has about 40 columns, Some of which need to be of a different value to the previous row, Is there a way i can seperate what i can duplicate and what i can not?

Cheers for your assistence mate
:)
 
Upvote 0
You never said if my previous script did what you wanted.
You mentioned column "A"

And I'm not sure what your second question is.

The row only duplicates if the same values are in column "A"

Did you try the script?
 
Upvote 0
Sorry,
Yes i tried the script, and it did as you said it would, It duplicated the whole row.
Only problem i now have is it is duplicating everything, not just the required cells.

Cheers
 
Upvote 0
And where did you say what cells to duplicate?

Your image shows A to D

So tell me what cells should de duplicated in we are working with Column "A"
 
Upvote 0
Is it just me or do you seem a little angry? If its too much drama, dont worry about it mate.

As mentioned above, this is apart of a larger table, And also i expected to be doing this with excel formula if it were possible, hence i didnt give FULL detail as i am quite proficient with basic excel formulas. and would have been able to work the formula into the rest of the table.

Now that it is using VBA, I am absolutely lost with the whole situation,

Column A - Date, This is what will be causing the code to dublicate as required,
Columns that req duplication if Column A stipulates are B, C, F, G, H, I, J
Columns that do not require duplication are, D, E, K through to BG

Columns K through to BG are all calculated using the manual input from Column D.

I hope the above is not too confusing.

Thanks
:)
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,054
Latest member
juliecooper255

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top