This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub DArrayCreator() | |
Dim wb As Workbook | |
Dim ws As Worksheet | |
Dim i, j, k As Integer | |
'Use this snippet for creating dynamic arrays from rows of data in Excel. | |
'Current snippet only allows for two columns of data. | |
'Enter source workbook location here | |
'Set wb = Workbooks.Open("C:\Users\Martin\Desktop\ArrayReplacer.xlsx") | |
Set wb = ActiveWorkbook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub CommandButton1_Click() | |
Dim month_a, month_b, month_c, j As Integer | |
Dim currentm, defaultm As Long | |
Dim pvt As PivotTable | |
Dim coll As Collection | |
Dim PivotRefs, i As Variant | |
Application.ScreenUpdating = False |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# installing/loading the package: | |
if(!require(installr)) { | |
install.packages("installr"); require(installr)} #load / install+load installr | |
# using the package: | |
updateR() # this will start the updating process of your R installation. It will check for newer versions, and if one is available, will guide you through the decisions you'd need to make. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("tm") | |
library("wordcloud") | |
library("SnowballC") | |
library("RColorBrewer") | |
library("tcltk2") | |
tk_choose.dir(getwd(),"Choose a suitable folder") | |
db = file.choose() | |
data <-read.csv(db,stringsAsFactors = FALSE) | |
#Create text corpuses for Promoters and Detractors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library("rvest") | |
url <- "https://bank.hangseng.com/1/2/rates/foreign-currency-tt-exchange-rates" | |
#Replace xpath with bits highlighting whole table on website using 'Inspect' | |
forex <- url %>% | |
html() %>% | |
html_nodes(xpath='//*[@id="viewns_7_0G3UNU10SD0MHTI7BJ91000000_:Display"]/div[1]/table') %>% | |
html_table() | |
forex <- forex[[1]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub FormatHero() | |
Dim x As Integer | |
x = InputBox("Bottom Row number please") | |
Columns("B:B").Select | |
ActiveWindow.FreezePanes = True | |
Columns("D:D").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove | |
Columns("G:G").Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
circle <- function(xorig, yorig, radius, add, ...){ | |
x <- seq(-radius, radius, length.out = 1000) | |
y <- sapply(x, function(z) sqrt(radius^2 - z^2)) | |
if(add == TRUE){ | |
lines(xorig + c(x, rev(x)), c(yorig + y, yorig + rev(-y)), | |
type = "l", ...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub FormatScatterPointsColour() | |
Dim i, j As Integer | |
j = ActiveChart.SeriesCollection.Count | |
Debug.Print j | |
For i = 1 To j | |
ActiveChart.FullSeriesCollection(i).Format.Fill.Visible = msoTrue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub SheetsFormatter() | |
Dim ws As Worksheet | |
For Each ws In ActiveWorkbook.Worksheets | |
Call action(ws) | |
Next ws | |
End Sub | |
Sub action(ws As Worksheet) |
OlderNewer