Cells(1, DELTA).Select
ActiveCell.EntireColumn.Insert
Cells(1, DELTA + 1).Select
ActiveCell.EntireColumn.Insert
DELTA = DELTA + 2
Columns(DELTA - 2).ColumnWidth = 5
Cells(1, DELTA).Select
ActiveCell.EntireColumn.Insert
Cells(1, DELTA + 1).Select
ActiveCell.EntireColumn.Insert
DELTA = DELTA + 2
Columns(DELTA - 2).ColumnWidth = 5
it is a 'modified' recorded macro to insert 2 blank columns starting from the column which is given by the variable DELTA and to set column width of that (+2-2 = 0) column.
procedure would be like:
Cells(1, DELTA).Resize(, 2).EntireColumn.Insert Columns(DELTA).ColumnWidth = 5
PLS DO NOT PM; OPEN A THREAD INSTEAD!!!
1) Posting Code
[CODE]PasteYourCodeHere[/CODE]
(or paste your code, select it, click # button)
2) Uploading File(s)
Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) (multiple files can be selected while holding Ctrl key) / Upload Files / Done
Replace company specific / sensitive / confidential data. Include so many rows and sheets etc in the uploaded workbook to enable the helpers visualize the data and table structure. Helpers do not need the entire workbook.
3) Testing the Codes
always back up your files before testing the codes.
4) Marking the Thread as Solved
from Thread Tools (on the top right corner, above the first message)
Also, what does this code mean as well especially the "=sum(R43C:R47C)"
Cells(48, DELTA - 2).FormulaR1C1 = "=sum(R43C:R47C)"
-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
Thanks it helped a lot !
I'm a newbie and I was tasked to improve on this current program in excel, I need all the help I can get, what does this code means too haha
InvoiceDate = Sheets("tracking").Rows(1).Find(What:=strSearch, LookIn:=xlValues, lookat:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, searchformat:=False).Column
It looks in row 1 of the sheet called "tracking" for whatever's in strSearch and comes back with the column number that it finds it in.
p45cal
Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.
Apologies - my comment was based on the code in PAB's post, which says:
The original code actually refers of course to rows 43 to 47 of the current column.Cells(ROW 48, COLUMN which is set by the variable DELTA).FormulaR1C1 = "SUM(RC43:RC47)"
Be as you wish to seem
Glad we could help, thanks for the feedback.
-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
12:45, restate my assumptions.
Mathematics is the language of nature.
Everything around us can be represented and understood through numbers.
If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.
-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-∏-
Hi, im just experimenting now, so why does my below code not work, I want it to add up all the numbers in column 7. When I debugged it it says type mismatch on this line TotalSum = TotalSum + Cells(counter2, 7)
Sub TotalSumFile()
Dim TotalSum As Integer
Dim counter2 As Integer
Dim lengthoflist As Long
lengthoflist = Sheets("RawData").UsedRange.Rows.Count
For counter2 = 1 To lengthoflist
If Cells(counter2, 7) <> 0 Then
TotalSum = TotalSum + Cells(counter2, 7)
End If
Range("m15") = TotalSum
Next counter2
End Sub
Whatever's in Cells(counter2, 7) is not a whole number (it could be text, or a number with decimals?)
p45cal
Everyone: If I've helped and you can't be bothered to acknowledge it, I can't be bothered to look at further posts from you.