![]() |
|
|
|
#1
|
|||
|
|||
|
Quote:
Man you really helped me! The fixmonth macro worked perfectly, and the code to fix the confirmation msg also worked ) I will learn about visual basic and macros, actually I learned a lot from you, but I am now racing the time, so what I do is observing what you do and then I will create something, I will deal later with weather data again but I will have time to learn and fix the issue ) Any ways, one last thing, when I applied your macro the "FixRows" macro it copied and pasted the header for the first 5 hours instead of just copying the data!! The result is attached in the sheet "06_2005_fixrow", I highlighted the error in red. If we you fixed this issue for me now I will finish the around 300 files by Sunday
|
|
#2
|
|||
|
|||
|
Hi,
try this instead! Good night (at least in my part of the world :-) Kind regards Bjorn Sub FixRows() Application.ScreenUpdating = False Dim rownum As Long Dim rowhour As Long Dim CopyOffset As Long rownum = 4 rowhour = 0 Do Until Cells(rownum, 4).Value = "" And rowhour = 0 If Cells(rownum, 4).Value <> rowhour And Cells(rownum, 4).Value Mod 100 = 0 Then Cells(rownum, 1).EntireRow.Insert If rownum = 4 Then CopyOffset = 1 Else CopyOffset = -1 Cells(rownum + CopyOffset, 1).Range("A1:L1").Copy _ Destination:=Cells(rownum, 1) Cells(rownum, 4).Value = rowhour If rowhour Mod 300 = 0 Then With Cells(rownum, 5) .NumberFormat = "0" .FormulaR1C1 = "9999" .Interior.ColorIndex = 6 .Interior.Pattern = xlSolid .Borders.LineStyle = xlcontinous .Borders.Weight = xlThin .Borders.ColorIndex = xlAutomatic End With Cells(rownum, 5).Copy Destination:=Cells(rownum, 1).Range("E1:L1") End If End If rownum = rownum + 1 rowhour = rowhour + 100 If rowhour = 2400 Then rowhour = 0 Loop Application.ScreenUpdating = False End Sub |
|
#3
|
|||
|
|||
|
Quote:
I live in Jordan, and it is now 12.33Am. Again, I highly appreciate your patience with me Best of luck my friend, and God bless you.Tareq. |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Wierd symbols inplace of "space", "indentation" etc | aka.bhagvanji | Word | 5 | 02-16-2012 11:50 AM |
Replacing a single "l" with a double "ll"
|
MShroff | Word | 8 | 01-19-2011 08:43 AM |
| "Microsoft Excel Application" missing in the "Component Services" on win08 | sword.fish | Excel | 0 | 02-26-2010 02:09 PM |
| How do I change the "and" to "or" with multiple Rules (and Alerts)? | bschimmel | Outlook | 0 | 11-16-2009 05:26 AM |
| Saving only "DATA" on excel? No white bottom? | jrasche2003@yahoo.com | Excel | 0 | 08-07-2006 09:27 AM |